From 89674e9d583c7829b1e427ab8ab5264bec43e134 Mon Sep 17 00:00:00 2001 From: morkt Date: Sat, 25 Feb 2017 02:02:41 +0400 Subject: [PATCH] (FileSystemStack): use ExceptionDispatchInfo to re-throw exception. --- GameRes/FileSystem.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GameRes/FileSystem.cs b/GameRes/FileSystem.cs index 3b72c809..dd587cc8 100644 --- a/GameRes/FileSystem.cs +++ b/GameRes/FileSystem.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Runtime.ExceptionServices; using System.Text.RegularExpressions; using GameRes.Strings; @@ -558,7 +559,7 @@ namespace GameRes if (null == arc) { if (FormatCatalog.Instance.LastError is OperationCanceledException) - throw FormatCatalog.Instance.LastError; + ExceptionDispatchInfo.Capture (FormatCatalog.Instance.LastError).Throw(); else throw new UnknownFormatException (FormatCatalog.Instance.LastError); }