From 52140d52210eda0f25ecab9f89b5c73473e9d8e0 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 17 Apr 2016 18:57:29 +0100 Subject: Add CLI for .NET version --- .../Couscous/mammoth/internal/util/PassThroughException.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'dotnet/Mammoth/Couscous/mammoth/internal/util/PassThroughException.cs') diff --git a/dotnet/Mammoth/Couscous/mammoth/internal/util/PassThroughException.cs b/dotnet/Mammoth/Couscous/mammoth/internal/util/PassThroughException.cs index 4bd2a2a..88597e3 100644 --- a/dotnet/Mammoth/Couscous/mammoth/internal/util/PassThroughException.cs +++ b/dotnet/Mammoth/Couscous/mammoth/internal/util/PassThroughException.cs @@ -10,6 +10,14 @@ namespace Mammoth.Couscous.org.zwobble.mammoth.@internal.util { throw new PassThroughException(exception); } } + + internal static T unwrap(SupplierWithException supplier) { + try { + return supplier.get(); + } catch (PassThroughException exception) { + throw exception._exception; + } + } private readonly IOException _exception; -- cgit v1.2.3