Interface: ResourcefulFormattedError
Standardized error response format used by the ResourcefulErrorMiddleware. Provides consistent structure for all API error responses with support for field-level validation details and error chaining.
Example
typescript
const formattedError: ResourcefulFormattedError = {
status: 422,
code: "E_VALIDATION_ERROR",
message: "Validation failed",
help: "Check the provided field values",
details: [
{
code: "E_REQUIRED",
message: "The email field is required",
target: "email",
},
],
};Properties
| Property | Type | Description |
|---|---|---|
code | string | Machine-readable error code |
details? | ResourcefulFormattedErrorDetails[] | Array of detailed error information, typically for validation errors |
help? | string | Optional help text providing guidance on how to resolve the error |
message | string | Human-readable error message |
status | number | HTTP status code for the error response |