function createLumberError(name) { function LumberError(message, details) { this.name = name; this.userMessage = message; this.details = details; Error.captureStackTrace(this, this.constructor); } return LumberError; }
function generic(x) { const error = Object.assign(new Error(x.message), x) Error.captureStackTrace(error, generic) return error }
function postgres(x) { const error = new PostgresError(x) Error.captureStackTrace(error, postgres) return error }
constructor(code, result, query, values) { const message = errorMessages[code].message; super(message); this.name = this.constructor.name; this.code = code; this.result = result; this.query = query; this.values = values; this.received = result.rows.length; Error.captureStackTrace(this, this.constructor); }
constructor(error, qf) { const isSqlError = error instanceof npm.minify.SQLParsingError; const message = isSqlError ? `Failed to parse the SQL.` : error.message; super(message); this.name = this.constructor.name; if (isSqlError) { this.error = error; } this.file = qf.file; this.options = qf.options; Error.captureStackTrace(this, this.constructor); }
function connection(x, options) { const error = Object.assign( new Error(('write ' + x + ' ' + (options.path || (options.host + ':' + options.port)))), { code: x, errno: x, address: options.path || options.host }, options.path ? {} : { port: options.port } ) Error.captureStackTrace(error, connection) return error }
constructor(error, pq) { const isQueryFileError = error instanceof QueryFileError; const message = isQueryFileError ? `Failed to initialize 'text' from a QueryFile.` : error; super(message); this.name = this.constructor.name; if (isQueryFileError) { this.error = error; } this.result = pq; Error.captureStackTrace(this, this.constructor); }
/** @function */ setTrace() { Error.captureStackTrace(this); /** @member {MetaStep} */ this.metaStep = detectMetaStep(this.stack.split('\n')); }
function notSupported(x) { const error = Object.assign( new Error(x + ' (B) is not supported'), { code: 'MESSAGE_NOT_SUPPORTED', name: x } ) Error.captureStackTrace(error, notSupported) return error }
/** * Creates a game error. * * @param {string} message The error message. */ constructor(message) { super(message); Error.captureStackTrace(this, GameError); }
constructor(e, { retriable = true } = {}) { super(e) Error.captureStackTrace(this, this.constructor) this.message = e.message || e this.name = 'KafkaJSError' this.retriable = retriable this.helpUrl = e.helpUrl }
constructor(message, ...args) { super(`[Polly] ${message}`, ...args); // Maintains proper stack trace for where our error was thrown (only available on V8) if (Error.captureStackTrace) { Error.captureStackTrace(this, PollyError); } this.name = 'PollyError'; }
constructor(message, ...args) { super(`[Polly] ${message}`, ...args); // Maintains proper stack trace for where our error was thrown (only available on V8) if (Error.captureStackTrace) { Error.captureStackTrace(this, PollyError); } this.name = 'PollyError'; }
/** * Creates a game error. * * @param {string} message The error message. */ constructor(message) { super(message); Error.captureStackTrace(this, GameError); }
constructor(error, ps) { const isQueryFileError = error instanceof QueryFileError; const message = isQueryFileError ? `Failed to initialize 'text' from a QueryFile.` : error; super(message); this.name = this.constructor.name; if (isQueryFileError) { this.error = error; } this.result = ps; Error.captureStackTrace(this, this.constructor); }