Creates a new ValidationError instance with optional details.
Optional
details: Record<string, unknown>Additional error details describing the validation failure.
Creates a new ValidationError instance with a custom message, type, and optional details.
Optional
message: stringA custom error message describing the validation issue.
Optional
type: ValidationErrorTypeA specific error type identifier.
Optional
details: Record<string, unknown>Additional error details.
Optional
detailsAdditional error details (optional).
Descriptive error message.
HTTP status code associated with the error.
Indicates if the response was successful (always false
for errors).
Error type.
Converts the error instance to a JSON object compatible with the ErrorResponse interface.
Serializable error object.
Represents a generic validation error (HTTP 422).
This error is thrown when the client sends data that is syntactically correct but semantically invalid (e.g., missing required fields, invalid formats).
Can be instantiated with either a custom message, type, and optional details, or directly with a
details
object.