Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CustomException extends Error {
- constructor(message) {
- super(message);
- this.name = this.constructor.name;
- if ('function' === typeof Error.captureStackTrace) {
- Error.captureStackTrace(this, this.constructor);
- } else {
- this.stack = (new Error(message)).stack;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement