Przeglądaj źródła

use specialized exception for interrupted sleep

tags/2.0.1
Jonathan Cobb 4 lat temu
rodzic
commit
1594a1ade1
2 zmienionych plików z 8 dodań i 1 usunięć
  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 Wyświetl plik

@@ -25,7 +25,7 @@ public class Sleep {
try {
Thread.sleep(millis);
} 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 Wyświetl plik

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

public class SleepInterruptedException extends IllegalStateException {

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

}

Ładowanie…
Anuluj
Zapisz