Error.prototype.toString() reads e.name, not e.prototype.constructor.name, so you can't rely on everyone to have subclassed Error.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
e instanceof Error
or: e instanceof MyError
why does toString() have anything to do with this? const e = new Error('bad stuff happened')
e.name = 'MyError'
without actually creating a MyError class to check with instanceof.Which popular libraries do this?
If it's just in a few places, it should be handled specifically, and use sane choices in other places.