Skip to main content
Module

x/sqlite/mod.ts>SqliteError

Deno SQLite module
Go to Latest
class SqliteError
extends Error
import { SqliteError } from "https://deno.land/x/sqlite@v3.5.0/mod.ts";

Errors which can occur while interacting with a database.

Constructors

new
SqliteError(context: Wasm | string, code?: Status)

Extension over the standard JS Error object to also contain class members for error code and error code name.

Instances of this class should not be constructed directly and should only be obtained from exceptions raised in this module.

Properties

code: Status

The SQLite status code which caused this error.

Errors that originate in the JavaScript part of the library will not have an associated status code. For these errors, the code will be Status.Unknown.

These codes are accessible via the exported Status object.

readonly
codeName: keyof Status

Key of code in exported status object.

E.g. if code is 19, codeName would be SqliteConstraint.