Re:Code Design Decision – Always throw custom exceptions
by eweise on Tuesday December 20, 2022 @12:45AM
(#34062029)
Totally agree about returning a 5XX error. In my app that would be a single RetryableException back to the caller instead of the internal db error.
[ Parent
| on HN ]
Re:Code Design Decision – Always throw custom exceptions
by hbrn on Tuesday December 20, 2022 @04:59PM
(#34073278)
Ugh. You should never call something "RetryableException".
1. You are in no position to decide for your customer whether exception is "Retryable".
2. For cases where you are in that position, you should just retry automatically.
3. RetryableException tells absolutely nothing about what happened. It's no better than raising MondayException for exceptions that happen on Monday.