Bun

interface

ErrorConstructor

interface ErrorConstructor

  • constructor ErrorConstructor(
    message?: string
    ): Error;
    constructor ErrorConstructor(
    message?: string,
    options?: ErrorOptions
    ): Error;
  • readonly prototype: Error
  • stackTraceLimit: number

    The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

    The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

    If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

  • targetObject: object,
    constructorOpt?: Function
    ): void;

    Create .stack property on a target object

  • 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

  • err: Error,
    stackTraces: CallSite[]
    ): any;

Referenced types

interface Error

interface ErrorOptions

  • cause?: unknown

    The cause of the error.