@ocap/util
Version:
utils shared across multiple forge js libs, works in both node.js and browser
26 lines (24 loc) • 546 B
JavaScript
//#region src/error.ts
var CustomError = class CustomError extends Error {
constructor(code, message, props = {}) {
super(message);
if (Error.captureStackTrace) Error.captureStackTrace(this, CustomError);
this.code = code;
this.props = {
persist: false,
...props
};
}
};
var PersistError = class extends CustomError {
constructor(code, message, props = {}) {
super(code, message);
this.props = {
persist: true,
...props
};
}
};
//#endregion
exports.CustomError = CustomError;
exports.PersistError = PersistError;