alwz
Version:
Extendable library for typecasting
24 lines • 573 B
JavaScript
/**
* @description Error with value property
* @property {any} [value] - can be used to store additional cause info
*/
export class ErrorValue extends Error {
/**
* @param {string} [message]
* @param {any} [value]
* @param {any} [options]
*/
constructor(message, value, options) {
// @ts-ignore
super(message, options);
this.value = value;
}
/**
* @description throw this instance of error
*/
throw() {
throw this;
}
}
export default ErrorValue;
//# sourceMappingURL=ErrorValue.js.map