MCPcopy Create free account
hub / github.com/auth0/auth0-cli / managementHTTPStatus

Function managementHTTPStatus

internal/cli/root.go:376–388  ·  view source on GitHub ↗

managementHTTPStatus extracts the HTTP status from a go-auth0 management API error anywhere in the error chain, supporting both the v1 (management.Error) and v2 (*core.APIError) SDK error types.

(err error)

Source from the content-addressed store, hash-verified

374// error anywhere in the error chain, supporting both the v1 (management.Error)
375// and v2 (*core.APIError) SDK error types.
376func managementHTTPStatus(err error) (int, bool) {
377 var v1 management.Error
378 if errors.As(err, &v1) {
379 return v1.Status(), true
380 }
381
382 var v2 *core.APIError
383 if errors.As(err, &v2) {
384 return v2.StatusCode, true
385 }
386
387 return 0, false
388}
389
390func errorClassForHTTPStatus(status int) string {
391 switch {

Callers 1

classifyCommandFailureFunction · 0.85

Calls 1

StatusMethod · 0.45

Tested by

no test coverage detected