Class: ValidationError
An error thrown to indicate that a name fails the validation rules.
Extends
Constructors
Constructor
new ValidationError(
error):ValidationError
Creates error containing the invalid nameType and a message that
briefly describes the problem if provided.
For example, a validation error can be interpreted as: "ValidationError (nameType='stringName')", "ValidationError (nameType='stringName'): message"
Parameters
error
ErrorMessage & object
Returns
ValidationError
Overrides
Properties
cause?
optionalcause?:unknown
Inherited from
message
message:
string
Inherited from
name
name:
string
Inherited from
nameType
readonlynameType:string
Name of the invalid nameType if available.
source
readonlysource:string|string[]
Inherited from
stack?
optionalstack?:string
Inherited from
type
readonlytype:NameErrorType
Inherited from
Accessors
hasMessage
Get Signature
get hasMessage():
boolean
Whether a message describing the failure exists.
Returns
boolean
Inherited from
sourceAsString
Get Signature
get sourceAsString():
string
The actual source input which caused the error.
Returns
string
Inherited from
Methods
toString()
toString():
string
Returns a string representation of the error.
Returns
string