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
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.