Skip to main content

Class: DBError

@divine/uri.DBError

An IOError subclass thrown by the DatabaseURI class and its subclasses.

Hierarchy

Constructors

constructor

new DBError(status, state, message, cause?, data?)

Constructs a new DBError exception.

Parameters

NameTypeDescription
statusstringA database-specific status code. Will be empty if the DB does not use custom status codes (like the PostgreSQL driver does).
statestringThe 5 character long SQLSTATE variable associated with this exception (for SQL databases at least; some databases, especially non-SQL ones, will only provide a generic state here and use status instead).
messagestringThe error message.
cause?ErrorIf this error was caused by another exception, pass it here to link it.
data?object & MetadataCustom, per-exception information associated with the exception.

Overrides

IOError.constructor

Defined in

uri/src/protocols/database.ts:366

Properties

cause

Optional cause: Error

The Error that caused this exception to be thrown.

Inherited from

IOError.cause

Defined in

uri/src/uri.ts:87


data

Optional data: object & Metadata

Custom, per-exception information associated with the exception.

Inherited from

IOError.data

Defined in

uri/src/uri.ts:96


state

state: string

The 5 character long SQLSTATE variable associated with this exception (for SQL databases at least; some databases, especially non-SQL ones, will only provide a generic state here and use status instead).

Defined in

uri/src/protocols/database.ts:366


status

status: string

A database-specific status code. Will be empty if the DB does not use custom status codes (like the PostgreSQL driver does).

Defined in

uri/src/protocols/database.ts:366

Methods

toString

toString(): string

Converts this DBError to a string.

Returns

string

Overrides

IOError.toString

Defined in

uri/src/protocols/database.ts:371