UNPKG

848 BTypeScriptView Raw
1import BaseError, { CommonErrorProperties, ErrorOptions } from './base-error';
2export interface DatabaseErrorParent extends Error, Pick<CommonErrorProperties, 'sql'> {
3 /** The parameters for the sql that triggered the error */
4 readonly parameters?: object;
5}
6export interface DatabaseErrorSubclassOptions extends ErrorOptions {
7 parent?: DatabaseErrorParent;
8 message?: string;
9}
10/**
11 * A base class for all database related errors.
12 */
13declare class DatabaseError extends BaseError implements DatabaseErrorParent, CommonErrorProperties {
14 parent: Error;
15 original: Error;
16 sql: string;
17 parameters: object;
18 /**
19 * @param parent The database specific error which triggered this one
20 * @param options
21 */
22 constructor(parent: DatabaseErrorParent, options?: ErrorOptions);
23}
24export default DatabaseError;