Skip to content

Instantly share code, notes, and snippets.

@ryanwilsonperkin
Last active January 15, 2025 15:00
Show Gist options
  • Save ryanwilsonperkin/86b336c3171e65dafc6bff66701f87b8 to your computer and use it in GitHub Desktop.
Save ryanwilsonperkin/86b336c3171e65dafc6bff66701f87b8 to your computer and use it in GitHub Desktop.
class CustomError extends Error {
constructor(...args) {
super(...args);
this.name = 'CustomError';
Object.setPrototypeOf(this, CustomError.prototype);
}
}
function f1() {f2()}
function f2() {throw new CustomError('test')}
f1();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment