Is there an easy way to call sleep and propagate exception
guava, java
Solution
Wrapping in a RuntimeException is likely to cause pain down the line. This is a complicated topic, I recommend the relevant section from Java Concurrency in Practice to fully understand your options. Guava has sleepUninterruptibly which implements one of the standard idioms described there.
Problem
I want to call `Thread.sleep`, and to propagate the `InterruptException` if indeed it's thrown. Imaginary syntax: ``` Interruptibles.sleep(1000); ``` which is equivalent to ``` try { Thread.sleep(1000); } catch (InterruptException e) { throw Throwables.propagate(e); } ``` Is there a similar function in a common library (guava, apache commons etc).