The InterruptedException is thrown when a thread is interrupted while it is waiting or sleeping. This can occur when a thread is interrupted by another thread or by the JVM.
See how to handle it