Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. class CustomException extends Error {
  2. constructor(message) {
  3. super(message);
  4. this.name = this.constructor.name;
  5. if ('function' === typeof Error.captureStackTrace) {
  6. Error.captureStackTrace(this, this.constructor);
  7. } else {
  8. this.stack = (new Error(message)).stack;
  9. }
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement