class

ValidationError(message, optionsopt)

Error thrown when validation fails

Constructor

class

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

function

toJSON() → {object}

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

toString() → {string}

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