error-code-domain
v1.0.5
Published
Javascript 'Error object' with code and domain properties
Downloads
8
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'
}