Class: ValidationError

ValidationError(message, optionsopt)

Error thrown when validation fails

Constructor

new ValidationError(message, optionsopt)

Parameters:
Name Type Attributes Description
message string Error message
options object <optional>
Additional options
Properties
Name Type Attributes Description
argumentName string <optional>
Name of the argument that failed validation
providedValue any <optional>
The value that was provided
expectedType string <optional>
The expected type or format
validationRule string <optional>
The validation rule that failed
Source:

Extends

Methods

toJSON() → {object}

Returns a detailed error object for logging/serialization
Overrides:
Source:
Returns:
Structured error information
Type
object

toString() → {string}

Returns a user-friendly error description
Overrides:
Source:
Returns:
Formatted error string
Type
string