Skip to content
Advertisement

Tag: exception-handling

Java 8 generic Retry if specific exception

I’m finding myself writing alot of retry loops that look like I want to write a generic function that accepts a Lambda and only retries on a specific error (in the above case thats SocketTimeoutException). I’ve seen some functions that accept a Runnable which is fine, but they don’t seem to allow limiting to specific exceptions. Any advice? Answer Have

Advertisement