Re:Try Three Times
by copsarebastards on Monday March 09, 2015 @03:01PM
(#9173102)
> But if you don't think there's a way to handle it, what good are exceptions for you - you might as well just barf.
They provide debugging information to you, as well as the ability to report to the user what went wrong rather than just that something went wrong.
> I think in practice people do use exceptions for things they both expect to happen, and know how to handle at that point.
This is true, and also causes terrible performance. Especially for situations like this where retries are likely to happen quite frequently.
It sounds like you think exceptions should be used for things you've never thought of, and have no code to handle. But if you don't think there's a way to handle it, what good are exceptions for you - you might as well just barf.
I think in practice people do use exceptions for things they both expect to happen, and know how to handle at that point.