2 ms·
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
by dspillett 5y ago
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.
- the_other 5y agoIsn'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.
- chrisco255 5y ago> you are asking others to deal with a significant change to a commonly accepted standard behaviour. For a JavaScript developer, that's just Tuesday.
- dspillett 5y agoAnd that Tuesday lasts all day until Friday. Sounds about right.