When does Java’s Thread.sleep throw InterruptedException?

You should generally NOT ignore the exception. Take a look at the following paper: Don’t swallow interrupts Sometimes throwing InterruptedException is not an option, such as when a task defined by Runnable calls an interruptible method. In this case, you can’t rethrow InterruptedException, but you also do not want to do nothing. When a blocking … Read more