Timeline for What's a good way to extend Error in JavaScript?
Current License: CC BY-SA 4.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 3, 2023 at 21:26 | comment | added | Moritz Friedrich |
Be aware that this.constructor.name cannot be used with bundlers that mangle class or function names, because the error class name in the minified code might be shortened.
|
|
Sep 21, 2022 at 8:45 | comment | added | NerdyDeeds |
In fairness, and keep in mind: this question was asked 12 years before you answered. extends , class , and super were all added in ES2015, several years after OP's initial query. Not knocking your approach; just tossing in a word of defense for some of the the other answers is all. Speaking as someone who's been a full-time FED since '96, let me assure you: there's a LOT of stuff that's WAY less complicated now, lol.
|
|
Aug 13, 2021 at 16:55 | history | answered | Corman | CC BY-SA 4.0 |