MCPcopy Create free account
hub / github.com/akash-network/provider / StatusCodeFrom

Function StatusCodeFrom

utils/httperror/httperror.go:45–54  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

43}
44
45func StatusCodeFrom(err error) int {
46 if err == nil {
47 return http.StatusOK
48 }
49 var ce *HttpError
50 if errors.As(err, &ce) {
51 return ce.StatusCode
52 }
53 return http.StatusInternalServerError
54}

Callers 10

writeClusterErrorFunction · 0.92
websocketCloseCodeFromFunction · 0.92
createStatusHandlerFunction · 0.92
createManifestHandlerFunction · 0.92
getManifestHandlerFunction · 0.92
TestStatusCodeFromFunction · 0.92
TestClusterErrorToHTTPFunction · 0.92
TestStatusCodeFromFunction · 0.85

Calls

no outgoing calls

Tested by 5

TestStatusCodeFromFunction · 0.74
TestClusterErrorToHTTPFunction · 0.74
TestStatusCodeFromFunction · 0.68