@betit/orion-node-sdk
Version:
SDK for orion
19 lines • 633 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const UUID = require('uuid');
class OrionError extends Error {
constructor(code, message, object) {
super(message || code);
this.code = code;
this.object = object;
this.uuid = UUID.v4();
// Delete this.message from original error. Hope this isn't breaking anything.
delete this.message;
this.message = message || code;
}
static decode(err) {
return new OrionError(err.code, err.message || '', err.object);
}
}
exports.OrionError = OrionError;
//# sourceMappingURL=error.js.map