Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MR414N-ID
GitHub Repository: MR414N-ID/botku2
Path: blob/master/node_modules/@hapi/hoek/lib/error.js
1126 views
1
'use strict';
2
3
const Stringify = require('./stringify');
4
5
6
const internals = {};
7
8
9
module.exports = class extends Error {
10
11
constructor(args) {
12
13
const msgs = args
14
.filter((arg) => arg !== '')
15
.map((arg) => {
16
17
return typeof arg === 'string' ? arg : arg instanceof Error ? arg.message : Stringify(arg);
18
});
19
20
super(msgs.join(' ') || 'Unknown error');
21
22
if (typeof Error.captureStackTrace === 'function') { // $lab:coverage:ignore$
23
Error.captureStackTrace(this, exports.assert);
24
}
25
}
26
};
27
28