Logger: Add feature toggle for errors in HTTP request logs (#64425)

This commit is contained in:
Emil Tullstedt
2023-03-31 15:38:09 +02:00
committed by GitHub
parent 977a7e9a55
commit be9361cb9e
19 changed files with 488 additions and 199 deletions

View File

@@ -565,7 +565,7 @@ func (g *GrafanaLive) handleOnRPC(client *centrifuge.Client, e centrifuge.RPCEve
if errors.Is(err, datasources.ErrDataSourceAccessDenied) {
return centrifuge.RPCReply{}, &centrifuge.Error{Code: uint32(http.StatusForbidden), Message: http.StatusText(http.StatusForbidden)}
}
var gfErr *errutil.Error
var gfErr errutil.Error
if errors.As(err, &gfErr) && gfErr.Reason.Status() == errutil.StatusBadRequest {
return centrifuge.RPCReply{}, &centrifuge.Error{Code: uint32(http.StatusBadRequest), Message: http.StatusText(http.StatusBadRequest)}
}