Skip to content

Instantly share code, notes, and snippets.

@abumalick
Created December 8, 2017 23:05
Show Gist options
  • Save abumalick/cde6e3f594b4f7ae8b51d453df8a9310 to your computer and use it in GitHub Desktop.
Save abumalick/cde6e3f594b4f7ae8b51d453df8a9310 to your computer and use it in GitHub Desktop.
Custom Error with ES6 class
// https://stackoverflow.com/a/32750746/1673761
class MyError extends Error {
constructor(message) {
super(message);
this.name = 'MyError';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment