Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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