UNPKG

@heidelmann91/custom-error

Version:

This package provides a custom error implementation

17 lines (16 loc) 514 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CustomError = void 0; class CustomError extends Error { constructor(message) { super(message); Object.defineProperty(this, 'name', { value: new.target.name, enumerable: false, configurable: true, }); Object.setPrototypeOf(this, new.target.prototype); Error.captureStackTrace(this, new.target.constructor); } } exports.CustomError = CustomError;