Last active
January 15, 2025 15:00
-
-
Save ryanwilsonperkin/86b336c3171e65dafc6bff66701f87b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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