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

Function HTTPStatus

internal/cli/client.go:3555–3565  ·  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

3553// request got no answer at all (the server was unreachable) or the error did
3554// not come from an HTTP answer.
3555func HTTPStatus(err error) int {
3556 var apiErr *APIError
3557 if errors.As(err, &apiErr) {
3558 return apiErr.Status
3559 }
3560 var statusErr *StatusError
3561 if errors.As(err, &statusErr) {
3562 return statusErr.Status
3563 }
3564 return 0
3565}
3566
3567// --- Item reminders (IDEA-2641) ---
3568

Callers 1

whoamiFailureFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected