errors

package
v1.38.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrPayloadFromSingleErr

func ErrPayloadFromSingleErr(principal *models.Principal, err error) *models.ErrorResponse

ErrPayloadFromSingleErr builds a single-message ErrorResponse with the principal's own namespace prefix stripped from err. Pass nil for global callers to leave the message unchanged. A nil err is tolerated and yields fmt's standard "<nil>" rendering rather than panicking, since this helper sits on dozens of REST error paths and a missed err-guard upstream should not crash the handler.

func ErrRestrictionViolation added in v1.38.0

func ErrRestrictionViolation(principal *models.Principal, err error) *models.RestrictionViolationResponse

restrictionViolationFromErr wraps a non-restriction error into the same RestrictionViolationResponse shape so handlers can return both 422 cases through the same swagger-generated payload type.

func HTTPStatusForNamespaceErr added in v1.38.5

func HTTPStatusForNamespaceErr(err error) (status int, ok bool)

HTTPStatusForNamespaceErr maps a namespace/collection lifecycle sentinel to its REST status: the terminal family (deleting, not-empty, invalid-state, suspended) renders 422, a resuming namespace renders 503. ok is false for anything else, so the caller falls through to its own default.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL