Package Exports
- error-code-domain
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (error-code-domain) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
error-code-domain
Javascript 'Error object' with code and domain properties
Sample:
//file: test.js
const ErrorWithCode = require("error-code-domain")("TEST");
try {
throw ErrorWithCode(-4000, "this is message");
} catch (error) {
console.log(error);
}
Console:
{ Error:
at ErrorWithCode (/***/error-code-domain/index.js:5:23)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
code: -4000,
domain: 'TEST'
message: 'this is message'
}