logoalt Hacker News

dmuxyesterday at 3:15 PM1 replyview on HN

>in places where it's pointless to check, like IOException

Can you explain why this is pointless? In my mind, this being a checked exception would hopefully be a hint that I should think about this failure-case and make an explicit decision whether to handle it or not. Network connection failed? Maybe I retry. Maybe I store that data somewhere else as a fall back. Isn't this similar to Go programmers needing to check if err is not nil?


Replies

mrkeenyesterday at 3:33 PM

I don't think I can recall a time where I routed-around-the-damage on the basis of a particular typed exception.

As soon as you consider retrying a network failure, you immediately need to start thinking about distributed systems failures, idempotency, and all that good stuff.

As soon as you start thinking about the above, it becomes immediately obvious that low-level calls should not be able to decide to re-run themselves.

show 1 reply