I'm not following, why can't I use:
e instanceof Error
or: e instanceof MyError
why does toString() have anything to do with this? 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.