Creates a new ValidationError instance with optional details.
Optionaldetails: Record<string, unknown>Additional error details describing the validation failure.
Creates a new ValidationError instance with a custom message, type, and optional details.
Optionalmessage: stringA custom error message describing the validation issue.
Optionaltype: ValidationErrorTypeA specific error type identifier.
Optionaldetails: Record<string, unknown>Additional error details.
OptionaldetailsAdditional 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
detailsobject.