constructor

SQL.SQLiteError.constructor

constructor SQLiteError(
message: string,
options: { byteOffset: number; code: string; errno: number }

Referenced types

  • readonly byteOffset?: number

    The UTF-8 byte offset of the token that the error refers to, counted from the start of the query text. -1 if the error refers to no token. Not set on errors that Bun raises itself.

  • cause?: unknown

    The cause of the error.

  • readonly code: string

    SQLite's extended result code, such as "SQLITE_CONSTRAINT_UNIQUE", or one of Bun's own codes, such as "ERR_SQLITE_CONNECTION_CLOSED"

  • readonly errno: number

    The number of the extended result code, such as 2067. errno & 0xff is the primary code. 0 on errors that Bun raises itself.

  • message: string
  • name: string
  • stack?: string
  • static 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

  • static 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

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