guava-retrying icon indicating copy to clipboard operation
guava-retrying copied to clipboard

Turn RetryException into RuntimeException?

Open dirkraft opened this issue 12 years ago • 7 comments
trafficstars

pls, I like when my exceptions explode all the way to the top liek in php. kthx

dirkraft avatar Mar 12 '13 18:03 dirkraft

good thing there is a mechanism called javadoc to show which exceptions are thrown even if they are not checked.

cyril265 avatar Mar 15 '14 13:03 cyril265

I should probably point out that @dirkraft likes to troll me occasionally in lolspeak. He and I have actually had discussions about switching the checked RetryException over to a RuntimeException, but it hasn't really been a priority (as evidenced by the lack of movement on this...). Additional opinions/comments/rants for this module shifting RetryException over to a RuntimeException are welcome here.

rholder avatar Mar 16 '14 00:03 rholder

I think the RetryException should stay checked because you always need to handle the case where all retries have failed. But it's kind of annoying to be forced to handle the ExcecutionException. It will be rethrown or logged most of the times.

cyril265 avatar Mar 16 '14 11:03 cyril265

I like the checked exceptions too – if someone is going to the bother of using a Retrier, it's clear that they care about catching exceptions.

marcomorain avatar Mar 18 '14 22:03 marcomorain

How about wrapping the cause of the ExecutionException in a RetryException? (and hide it completely from API consumers)

andreisavu avatar Mar 27 '14 22:03 andreisavu

I, too, liked the checked exception.

JensRantil avatar Aug 24 '15 15:08 JensRantil

Checked exceptions leave the retry pretty much outside of the clean lamda world. Java 8 is here, and unless a Runtime Exception is used I (and probably others) will prefer other retry solutions. Making assumptions over users desire of handling the exception is wrong, specially when the outcome is to force them to do the thing you might like.

vromero avatar May 03 '16 17:05 vromero