Creates an instance of ValidationError
.
An array of validation error objects.
The context where the validation failed.
The HTTP status code representing a validation error.
Optional
stackStatic
Optional
prepareOptional override for formatting stack traces
Static
stackSerializes the error details into an array of BaseServiceError
objects.
This method maps over the validation error details to create a structured response for each validation error, including the status code, type, message, path of the invalid input, and additional details.
An array of serialized error details for each validation error, which includes:
code
: 400 (Bad Request)type
: "ValidationError" (the name of the error class)message
: A user-friendly message indicating the validation issue.path
: An array showing the specific path of the invalid input.details
: An array containing additional information about the error.Converts the error object into a standardized JSON structure.
errors
with the serialized errors.Static
capture
Represents a validation error that occurs when the input data does not conform to a specified schema.
This class extends the
ClientError
class and is used to handle HTTP 400 Bad Request errors resulting from invalid input.ValidationError