Hacker News new | past | comments | ask | show | jobs | submit login

It's very likely someone did

  const e = new Error('bad stuff happened')
  e.name = 'MyError'
without actually creating a MyError class to check with instanceof.



Unless it's common in popular libraries/packages, I don't see why I need to take it into account.

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.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: