You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenTSDB PutDataPoints returns "invalid response type" when the datapoints argument has the wrong type #4323
PutDataPoints checks the type of its datas argument but reports a failure using the response-type sentinel:
pkg/gofr/datasource/opentsdb/opentsdb.go:202-205
datapoints, ok:=datas.([]DataPoint)
if!ok {
returnfmt.Errorf("%w: Must be []DataPoint", errInvalidResponseType)
}
So passing the wrong type for the input gives invalid response type: Must be []DataPoint, and errors.Is(err, errInvalidResponseType) matches even though the response was fine. The same file already uses errInvalidParam ("invalid parameter type") for the equivalent input check in QueryLatestDataPoints (:291-294).
Expected behavior
Return errInvalidParam for a wrong datas type:
returnfmt.Errorf("%w: Must be []DataPoint", errInvalidParam)
Activity