ValidationError
Defined in: error.ts:21
Represents a validation error for a specific key path
Extends
Section titled “Extends”Error
Constructor
Section titled “Constructor”new ValidationError(
args):ValidationError
Defined in: error.ts:38
Create a validation error
Parameters
Section titled “Parameters”keyPath
Section titled “keyPath”Path to the invalid field
reason
Section titled “reason”string | Error
Error message or Error object
Returns
Section titled “Returns”ValidationError
Remarks
Section titled “Remarks”An Error reason becomes the cause, and its message at that moment becomes the error's message.
An error from another realm is recognized by its shape rather than by instanceof, so a cause is
not necessarily an instance of Error.
Overrides
Section titled “Overrides”Error.constructor
Members
Section titled “Members”cause?
Section titled “cause?”
readonlyoptionalcause?:Error
Defined in: error.ts:25
Overrides
Section titled “Overrides”Error.cause
readonlykey:KeyPath
Defined in: error.ts:22
keyPath
Section titled “keyPath”
readonlykeyPath:KeyPath
Defined in: error.ts:23
message
Section titled “message”
readonlymessage:string
Defined in: error.ts:24
Overrides
Section titled “Overrides”Error.message