浏览代码

use specialized exception for interrupted sleep

tags/2.0.1
Jonathan Cobb 4 年前
父节点
当前提交
1594a1ade1
共有 2 个文件被更改,包括 8 次插入1 次删除
  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 查看文件

@@ -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 查看文件

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

public class SleepInterruptedException extends IllegalStateException {

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

}

正在加载...
取消
保存