NitroSQLite
react-native-nitro-sqliteClasses

SQLiteError

TypeScript

Source files: TypeScript

Error thrown by managed NitroSQLite operations. Native errors are wrapped with this class.

Extends

  • Error

Constructors

Constructor

new SQLiteError(message, options?): SQLiteError

Defined in: packages/react-native-nitro-sqlite/src/SQLiteError.ts:56

Create an error with a message and optional cause.

Parameters

message

string

options?

ErrorOptions

Returns

SQLiteError

Overrides

Error.constructor

Properties

sqliteCode

readonly sqliteCode: number | undefined

Defined in: packages/react-native-nitro-sqlite/src/SQLiteError.ts:53

SQLite result code for native operations that report it, otherwise undefined. Includes extended codes. Use sqliteCode & 0xff for the primary code, such as 5 (SQLITE_BUSY) or 6 (SQLITE_LOCKED). Cursor prepare and page failures report it.


type

readonly type: SQLiteExceptionType | undefined

Defined in: packages/react-native-nitro-sqlite/src/SQLiteError.ts:47

Recognized native category from SQLiteExceptionType, or undefined for JavaScript failures and unrecognized native categories.

Methods

fromError()

static fromError(error): SQLiteError

Defined in: packages/react-native-nitro-sqlite/src/SQLiteError.ts:72

Convert an unknown thrown value to SQLiteError. Existing instances pass through; Error values keep their stack and cause.

Parameters

error

unknown

Value to normalize.

Returns

SQLiteError

A SQLiteError instance.

On this page