struct

Alumna::ServiceError

Inherits Struct < Value < Object

Constructors

new(message : String, status : Int32 = 400, details : Hash(String, AnyData) | Nil = nil)
Source

Class methods

bad_request(message : String, details : Hash(String, AnyData) | Nil = nil)
Source
bad_request(message : String, **kwargs)

Auto-casting helper for fluid DX. Note: Crystal's overload resolution cleanly prefers the details = nil method signature when called without any kwargs.

Source
forbidden(message : String = "Forbidden")
Source
internal(message : String = "Internal server error")
Source
not_found(message : String = "Not found")
Source
unauthorized(message : String = "Unauthorized")
Source
unprocessable(message : String, details : Hash(String, AnyData) | Nil = nil)
Source
unprocessable(message : String, **kwargs)

Auto-casting helper for fluid DX. Note: Crystal's overload resolution cleanly prefers the details = nil method signature when called without any kwargs.

Source

Instance methods

details

Returns the details hash, allocating a temporary empty one if none exists. Because ServiceError is a struct (value type), we intentionally avoid lazy-mutating (@details ||=) to prevent unintended copy semantics and state divergence.

Source
details?
Source
message
Source
status
Source