Browse Source

use specialized exception for interrupted sleep

tags/2.0.1
Jonathan Cobb 4 years ago
parent
commit
1594a1ade1
2 changed files with 8 additions and 1 deletions
  1. +1
    -1
      src/main/java/org/cobbzilla/util/system/Sleep.java
  2. +7
    -0
      src/main/java/org/cobbzilla/util/system/SleepInterruptedException.java

+ 1
- 1
src/main/java/org/cobbzilla/util/system/Sleep.java View File

@@ -25,7 +25,7 @@ public class Sleep {
try { try {
Thread.sleep(millis); Thread.sleep(millis);
} catch (InterruptedException e) { } catch (InterruptedException e) {
throw new IllegalStateException("sleep interrupted (" + reason + ")");
throw new SleepInterruptedException("sleep interrupted (" + reason + ")");
} }
} }




+ 7
- 0
src/main/java/org/cobbzilla/util/system/SleepInterruptedException.java View File

@@ -0,0 +1,7 @@
package org.cobbzilla.util.system;

public class SleepInterruptedException extends IllegalStateException {

public SleepInterruptedException(String msg) { super(msg); }

}

Loading…
Cancel
Save