An error type thrown when a value fails a validation function test.
Several features inherited from
XtError
const isString = (value) => typeof value === 'string'new XtInvalidError(2, isString)//=> XtInvalidError: Expected 'isString' to return 'true' for input: 2new XtInvalidError('Adam', isString, false)//=> XtInvalidError: Expected 'isString' to return 'false' for input: Adam Copy
const isString = (value) => typeof value === 'string'new XtInvalidError(2, isString)//=> XtInvalidError: Expected 'isString' to return 'true' for input: 2new XtInvalidError('Adam', isString, false)//=> XtInvalidError: Expected 'isString' to return 'false' for input: Adam
Returns a new XtInvalidError instance.
Optional
Parsed stack trace.
Static
Optional override for formatting stack traces
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Protected
Renders the error-message, stack-trace and any other own-properties as a colorful formatted string that is easy to read when printed to in the terminal.
Returns the same as toString.
XtError.prototype.toString
Create .stack property on a target object
Generated using TypeDoc
An error type thrown when a value fails a validation function test.
Several features inherited from
See
XtError
Example