MCPcopy
hub / github.com/grafana/dskit / errorToStatusCode

Function errorToStatusCode

middleware/grpc_instrumentation.go:263–273  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

261}
262
263func errorToStatusCode(err error) codes.Code {
264 if err == nil {
265 return codes.OK
266 }
267
268 if errors.Is(err, context.Canceled) {
269 return codes.Canceled
270 }
271
272 return grpcutil.ErrorToStatusCode(err)
273}
274
275func isHTTPStatusCode(statusCode codes.Code) bool {
276 return int(statusCode) >= 100 && int(statusCode) < 600

Calls 2

ErrorToStatusCodeFunction · 0.92
IsMethod · 0.80