News for hackers. Stuff that matters.
Re:You Can Throw() Anything in JavaScript – and Other Async/... by dspillett on Friday April 08, 2022 @07:20AM (#30955599)
That sounds fine as a quick hack in your own code that you never intend others to use, but if something like that escapes your library into calling code (isn't always properly trapped by your exception handling due to a bug) you are asking others to deal with a significant change to a commonly accepted standard behaviour.
Re:You Can Throw() Anything in JavaScript – and Other Async/... by the_other on Friday April 08, 2022 @07:42AM (#30955734)
Isn't "ensuring you always throw Errors" the same level of code cleanliness as "keep a top level catch in your code" or "document the errors and exceptions of your API"? If you make your team do one, you can make them do another.
Re:You Can Throw() Anything in JavaScript – and Other Async/... by chrisco255 on Friday April 08, 2022 @09:00AM (#30956294)
> you are asking others to deal with a significant change to a commonly accepted standard behaviour.

For a JavaScript developer, that's just Tuesday.

Re:You Can Throw() Anything in JavaScript – and Other Async/... by dspillett on Friday April 08, 2022 @09:58AM (#30956822)
And that Tuesday lasts all day until Friday. Sounds about right.