MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / HTTPStatus

Function HTTPStatus

internal/cli/client.go:3970–3980  ·  view source on GitHub ↗

HTTPStatus is the HTTP status a request error carries, or 0 when the request got no answer at all (the server was unreachable) or the error did not come from an HTTP answer.

(err error)

Source from the content-addressed store, hash-verified

3968// request got no answer at all (the server was unreachable) or the error did
3969// not come from an HTTP answer.
3970func HTTPStatus(err error) int {
3971 var apiErr *APIError
3972 if errors.As(err, &apiErr) {
3973 return apiErr.Status
3974 }
3975 var statusErr *StatusError
3976 if errors.As(err, &statusErr) {
3977 return statusErr.Status
3978 }
3979 return 0
3980}
3981
3982// --- Item reminders (IDEA-2641) ---
3983

Callers 5

whoamiFailureFunction · 0.92
authSignupCmdFunction · 0.92
authClaimLinkCmdFunction · 0.92
AttachmentNotFoundFunction · 0.85

Calls

no outgoing calls

Tested by 1