ClientFailureMessage

org.sigilaris.core.failure.ClientFailureMessage

Factory for structured client-facing failure messages.

Encodes failure information into a standardized string format using FailureMessageFormat, categorized by client failure kind (invalid request, forbidden, not found).

Attributes

Source
ClientFailureMessage.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

enum Kind

Classification of client failure kinds.

Classification of client failure kinds.

Attributes

Source
ClientFailureMessage.scala
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def errorKey(kind: Kind, domain: String, reason: String, code: FailureCode): ErrorKey

Builds an ErrorKey for a client failure, validating the key format.

Builds an ErrorKey for a client failure, validating the key format.

Value parameters

code

the failure code to attach

domain

the error domain

kind

the client failure kind

reason

the specific reason

Attributes

Returns

an ErrorKey with the validated or fallback key

Source
ClientFailureMessage.scala
def forbidden(domain: String, reason: String, message: String, detail: Option[String]): String

Formats a forbidden failure message with the default failure code.

Formats a forbidden failure message with the default failure code.

Value parameters

detail

optional additional detail

domain

the error domain

message

human-readable description

reason

the specific reason within the domain

Attributes

Returns

the encoded failure message string

Source
ClientFailureMessage.scala
def forbiddenWithCode(domain: String, reason: String, message: String, detail: Option[String], code: FailureCode): String

Formats a forbidden failure message with a custom failure code.

Formats a forbidden failure message with a custom failure code.

Value parameters

code

the failure code to attach

detail

optional additional detail

domain

the error domain

message

human-readable description

reason

the specific reason within the domain

Attributes

Returns

the encoded failure message string

Source
ClientFailureMessage.scala
def invalidRequest(domain: String, reason: String, message: String, detail: Option[String]): String

Formats an invalid-request failure message with the default failure code.

Formats an invalid-request failure message with the default failure code.

Value parameters

detail

optional additional detail appended after a separator

domain

the error domain (e.g., "account", "transaction")

message

human-readable description

reason

the specific reason within the domain

Attributes

Returns

the encoded failure message string

Source
ClientFailureMessage.scala
def invalidRequestWithCode(domain: String, reason: String, message: String, detail: Option[String], code: FailureCode): String

Formats an invalid-request failure message with a custom failure code.

Formats an invalid-request failure message with a custom failure code.

Value parameters

code

the failure code to attach

detail

optional additional detail

domain

the error domain

message

human-readable description

reason

the specific reason within the domain

Attributes

Returns

the encoded failure message string

Source
ClientFailureMessage.scala
def notFound(domain: String, reason: String, message: String, detail: Option[String]): String

Formats a not-found failure message with the default failure code.

Formats a not-found failure message with the default failure code.

Value parameters

detail

optional additional detail

domain

the error domain

message

human-readable description

reason

the specific reason within the domain

Attributes

Returns

the encoded failure message string

Source
ClientFailureMessage.scala
def notFoundWithCode(domain: String, reason: String, message: String, detail: Option[String], code: FailureCode): String

Formats a not-found failure message with a custom failure code.

Formats a not-found failure message with a custom failure code.

Value parameters

code

the failure code to attach

detail

optional additional detail

domain

the error domain

message

human-readable description

reason

the specific reason within the domain

Attributes

Returns

the encoded failure message string

Source
ClientFailureMessage.scala

Concrete fields

Failure code for forbidden errors.

Failure code for forbidden errors.

Attributes

Source
ClientFailureMessage.scala

Failure code for invalid request errors.

Failure code for invalid request errors.

Attributes

Source
ClientFailureMessage.scala

Failure code for not-found errors.

Failure code for not-found errors.

Attributes

Source
ClientFailureMessage.scala