MCPcopy Create free account
hub / github.com/WiseLibs/better-sqlite3 / SqliteError

Function SqliteError

lib/sqlite-error.js:4–16  ·  view source on GitHub ↗
(message, code)

Source from the content-addressed store, hash-verified

2const descriptor = { value: 'SqliteError', writable: true, enumerable: false, configurable: true };
3
4function SqliteError(message, code) {
5 if (new.target !== SqliteError) {
6 return new SqliteError(message, code);
7 }
8 if (typeof code !== 'string') {
9 throw new TypeError('Expected second argument to be a string');
10 }
11 Error.call(this, message);
12 descriptor.value = '' + message;
13 Object.defineProperty(this, 'message', descriptor);
14 Error.captureStackTrace(this, SqliteError);
15 this.code = code;
16}
17Object.setPrototypeOf(SqliteError, Error);
18Object.setPrototypeOf(SqliteError.prototype, Error.prototype);
19Object.defineProperty(SqliteError.prototype, 'name', descriptor);

Callers 1

01.sqlite-error.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected