summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2022-01-13 13:32:21 +0100
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2022-01-14 11:07:20 +0100
commit9bc3f73b3630b90d0fe2c56ee04c03fb3c2f05bc (patch)
tree5f7c10c5ec46c6550d9f584c92abace956bffac6
parenta0ba343a01db44795cce1c610d5d14d7fb450e71 (diff)
Add replacement for Guava's UncheckedTimeoutException
-rw-r--r--vespajlib/src/main/java/com/yahoo/concurrent/UncheckedTimeoutException.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/concurrent/UncheckedTimeoutException.java b/vespajlib/src/main/java/com/yahoo/concurrent/UncheckedTimeoutException.java
new file mode 100644
index 00000000000..e7d124f2288
--- /dev/null
+++ b/vespajlib/src/main/java/com/yahoo/concurrent/UncheckedTimeoutException.java
@@ -0,0 +1,21 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.concurrent;
+
+import java.util.concurrent.TimeoutException;
+
+/**
+ * Unchecked alternative for {@link java.util.concurrent.TimeoutException}.
+ *
+ * @author bjorncs
+ */
+public class UncheckedTimeoutException extends RuntimeException {
+
+ public UncheckedTimeoutException(TimeoutException cause) { super(cause.getMessage(), cause); }
+
+ public UncheckedTimeoutException(String message) { super(message); }
+
+ public UncheckedTimeoutException(Throwable cause) { super(cause); }
+
+ public UncheckedTimeoutException(String message, Throwable cause) { super(message, cause); }
+
+}