MCPcopy
hub / github.com/sequelize/sequelize / DatabaseError

Class DatabaseError

src/errors/database-error.ts:18–45  ·  view source on GitHub ↗

* A base class for all database related errors.

Source from the content-addressed store, hash-verified

16 * A base class for all database related errors.
17 */
18class DatabaseError
19 extends BaseError
20 implements DatabaseErrorParent, CommonErrorProperties
21{
22 parent: Error;
23 original: Error;
24 sql: string;
25 parameters: object;
26
27 /**
28 * @param parent The database specific error which triggered this one
29 * @param options
30 */
31 constructor(parent: DatabaseErrorParent, options: ErrorOptions = {}) {
32 super(parent.message);
33 this.name = 'SequelizeDatabaseError';
34
35 this.parent = parent;
36 this.original = parent;
37
38 this.sql = parent.sql;
39 this.parameters = parent.parameters ?? {};
40
41 if (options.stack) {
42 this.stack = options.stack;
43 }
44 }
45}
46
47export default DatabaseError;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected