@hapi/hoek
Advanced tools
Comparing version 8.0.0 to 8.0.1
@@ -595,16 +595,20 @@ 'use strict'; | ||
if (args.length === 1 && args[0] instanceof Error) { | ||
throw args[0]; | ||
} | ||
throw new exports.Error(args); | ||
}; | ||
const msgs = args | ||
.filter((arg) => arg !== '') | ||
.map((arg) => { | ||
return typeof arg === 'string' ? arg : arg instanceof Error ? arg.message : exports.stringify(arg); | ||
}); | ||
exports.Error = class extends Error { | ||
const error = new Error(msgs.join(' ') || 'Unknown error'); | ||
Error.captureStackTrace(error, exports.assert); | ||
throw error; | ||
constructor(args) { | ||
const msgs = args | ||
.filter((arg) => arg !== '') | ||
.map((arg) => { | ||
return typeof arg === 'string' ? arg : arg instanceof Error ? arg.message : exports.stringify(arg); | ||
}); | ||
super(msgs.join(' ') || 'Unknown error'); | ||
Error.captureStackTrace(this, exports.assert); | ||
} | ||
}; | ||
@@ -611,0 +615,0 @@ |
{ | ||
"name": "@hapi/hoek", | ||
"description": "General purpose node utilities", | ||
"version": "8.0.0", | ||
"version": "8.0.1", | ||
"repository": "git://github.com/hapijs/hoek", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42962
1143