Class: DBError
@divine/uri.DBError
An IOError subclass thrown by the DatabaseURI class and its subclasses.
Hierarchy
↳
DBError
Constructors
constructor
• new DBError(status
, state
, message
, cause?
, data?
)
Constructs a new DBError exception.
Parameters
Name | Type | Description |
---|---|---|
status | string | A database-specific status code. Will be empty if the DB does not use custom status codes (like the PostgreSQL driver does). |
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). |
message | string | The error message. |
cause? | Error | If this error was caused by another exception, pass it here to link it. |
data? | object & Metadata | Custom, per-exception information associated with the exception. |
Overrides
Defined in
uri/src/protocols/database.ts:366
Properties
cause
• Optional
cause: Error
The Error that caused this exception to be thrown.
Inherited from
Defined in
data
• Optional
data: object
& Metadata
Custom, per-exception information associated with the exception.
Inherited from
Defined in
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