| 1 | 'use strict'; |
| 2 | |
| 3 | class SqliteError extends Error { |
| 4 | constructor(message, code) { |
| 5 | if (typeof code !== 'string') { |
| 6 | throw new TypeError('Expected second argument to be a string'); |
| 7 | } |
| 8 | |
| 9 | super('' + message); |
| 10 | this.code = code; |
| 11 | |
| 12 | if (typeof Error.captureStackTrace === 'function') { |
| 13 | Error.captureStackTrace(this, SqliteError); |
| 14 | } |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | Object.defineProperty(SqliteError.prototype, 'name', { |
| 19 | value: 'SqliteError', |
nothing calls this directly
no outgoing calls
no test coverage detected