aboutsummaryrefslogtreecommitdiff
path: root/dotnet/Mammoth/Couscous/mammoth/internal/util/PassThroughException.cs
diff options
context:
space:
mode:
Diffstat (limited to 'dotnet/Mammoth/Couscous/mammoth/internal/util/PassThroughException.cs')
-rw-r--r--dotnet/Mammoth/Couscous/mammoth/internal/util/PassThroughException.cs29
1 files changed, 0 insertions, 29 deletions
diff --git a/dotnet/Mammoth/Couscous/mammoth/internal/util/PassThroughException.cs b/dotnet/Mammoth/Couscous/mammoth/internal/util/PassThroughException.cs
deleted file mode 100644
index 88597e3..0000000
--- a/dotnet/Mammoth/Couscous/mammoth/internal/util/PassThroughException.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using Mammoth.Couscous.java.lang;
-using Mammoth.Couscous.java.io;
-
-namespace Mammoth.Couscous.org.zwobble.mammoth.@internal.util {
- internal class PassThroughException : RuntimeException {
- internal static T wrap<T>(SupplierWithException<T, IOException> supplier) {
- try {
- return supplier.get();
- } catch (IOException exception) {
- throw new PassThroughException(exception);
- }
- }
-
- internal static T unwrap<T>(SupplierWithException<T, IOException> supplier) {
- try {
- return supplier.get();
- } catch (PassThroughException exception) {
- throw exception._exception;
- }
- }
-
- private readonly IOException _exception;
-
- internal PassThroughException(IOException exception) {
- _exception = exception;
- }
- }
-}
-