mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-13 18:35:58 +08:00
fix(nil-pointer): wrong error passed | 2262 (#7463)
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
This commit is contained in:
parent
61de2d414d
commit
459712d25c
@ -67,17 +67,17 @@ func (aH *APIHandler) ListMetrics(w http.ResponseWriter, r *http.Request) {
|
|||||||
bodyBytes, _ := io.ReadAll(r.Body)
|
bodyBytes, _ := io.ReadAll(r.Body)
|
||||||
r.Body = io.NopCloser(bytes.NewBuffer(bodyBytes))
|
r.Body = io.NopCloser(bytes.NewBuffer(bodyBytes))
|
||||||
ctx := r.Context()
|
ctx := r.Context()
|
||||||
params, apiError := explorer.ParseSummaryListMetricsParams(r)
|
params, apiErr := explorer.ParseSummaryListMetricsParams(r)
|
||||||
if apiError != nil {
|
if apiErr != nil {
|
||||||
zap.L().Error("error parsing metric list metric summary api request", zap.Error(apiError.Err))
|
zap.L().Error("error parsing metric list metric summary api request", zap.Error(apiErr.Err))
|
||||||
RespondError(w, model.BadRequest(apiError), nil)
|
RespondError(w, model.BadRequest(apiErr), nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
slmr, apiErr := aH.SummaryService.ListMetricsWithSummary(ctx, params)
|
slmr, apiErr := aH.SummaryService.ListMetricsWithSummary(ctx, params)
|
||||||
if apiErr != nil {
|
if apiErr != nil {
|
||||||
zap.L().Error("error parsing metric query range params", zap.Error(apiErr.Err))
|
zap.L().Error("error in getting list metrics summary", zap.Error(apiErr.Err))
|
||||||
RespondError(w, apiError, nil)
|
RespondError(w, apiErr, nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
aH.Respond(w, slmr)
|
aH.Respond(w, slmr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user