The name of the contract that was violated.
The layer in which the contract violation occurred (e.g., "presentation", "business").
The original error that caused the contract violation.
Optional
codeThe name of the contract that was violated.
Optional
detailsOptional
isThe layer in which the contract violation occurred (e.g., "presentation", "business").
The original error that caused the contract violation.
Provides an appropriate response object based on the contract's layer. This can be used by integration layers (e.g., Next.js Server Actions or Middleware) to return a user-friendly or system-appropriate response.
An object containing response details, such as redirect paths or error messages.
Represents an error specifically indicating a violation of a contract condition. This error wraps an original error and provides context about the contract and layer where the violation occurred.