@endo/common
Advanced tools
Comparing version 1.0.3 to 1.1.0
{ | ||
"name": "@endo/common", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "common low level utilities", | ||
@@ -44,9 +44,9 @@ "keywords": [], | ||
"dependencies": { | ||
"@endo/errors": "^1.0.3", | ||
"@endo/eventual-send": "^1.1.1", | ||
"@endo/promise-kit": "^1.0.3" | ||
"@endo/errors": "^1.1.0", | ||
"@endo/eventual-send": "^1.1.2", | ||
"@endo/promise-kit": "^1.0.4" | ||
}, | ||
"devDependencies": { | ||
"@endo/lockdown": "^1.0.3", | ||
"@endo/ses-ava": "^1.1.1", | ||
"@endo/lockdown": "^1.0.4", | ||
"@endo/ses-ava": "^1.1.2", | ||
"ava": "^5.3.0", | ||
@@ -77,3 +77,3 @@ "c8": "^7.14.0", | ||
}, | ||
"gitHead": "f731c5c12f8d185dbf2daf53ec6a57e5ac56e4e9" | ||
"gitHead": "297fed572fedec0e1ae3ce34cf409f9d45233d43" | ||
} |
@@ -1,2 +0,2 @@ | ||
export function throwLabeled(innerErr: Error, label: string | number, ErrorConstructor?: ErrorConstructor | undefined): never; | ||
export function throwLabeled(innerErr: Error, label: string | number, errConstructor?: import("ses").GenericErrorConstructor | undefined, options?: import("ses").AssertMakeErrorOptions | undefined): never; | ||
//# sourceMappingURL=throw-labeled.d.ts.map |
@@ -10,10 +10,20 @@ import { X, makeError, annotateError } from '@endo/errors'; | ||
* @param {string|number} label | ||
* @param {ErrorConstructor=} ErrorConstructor | ||
* @param {import('ses').GenericErrorConstructor} [errConstructor] | ||
* @param {import('ses').AssertMakeErrorOptions} [options] | ||
* @returns {never} | ||
*/ | ||
export const throwLabeled = (innerErr, label, ErrorConstructor = undefined) => { | ||
export const throwLabeled = ( | ||
innerErr, | ||
label, | ||
errConstructor = undefined, | ||
options = undefined, | ||
) => { | ||
if (typeof label === 'number') { | ||
label = `[${label}]`; | ||
} | ||
const outerErr = makeError(`${label}: ${innerErr.message}`, ErrorConstructor); | ||
const outerErr = makeError( | ||
`${label}: ${innerErr.message}`, | ||
errConstructor, | ||
options, | ||
); | ||
annotateError(outerErr, X`Caused by ${innerErr}`); | ||
@@ -20,0 +30,0 @@ throw outerErr; |
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
34710
388
Updated@endo/errors@^1.1.0
Updated@endo/eventual-send@^1.1.2
Updated@endo/promise-kit@^1.0.4