ErrorConstructor

Bun

Symbol

ErrorConstructor

interface ErrorConstructor

  • constructor (message?: string): Error
    constructor (message?: string, options?: ErrorOptions): Error
  • prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any

    Optional override for formatting stack traces

  • readonly prototype: Error
  • stackTraceLimit: number

    The maximum number of stack frames to capture.

  • captureStackTrace(targetObject: object, constructorOpt?: Function): void

    Create .stack property on a target object

  • isError(value: unknown): value is Error

    Check if a value is an instance of Error

    @param value

    The value to check

    @returns

    True if the value is an instance of Error, false otherwise

Referenced types

interface Error

interface ErrorOptions

  • cause?: unknown

    The cause of the error.