diff --git a/QuickLook.Plugin/QuickLook.Plugin.PDFViewer/Plugin.cs b/QuickLook.Plugin/QuickLook.Plugin.PDFViewer/Plugin.cs index d4abb63..d3b340b 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.PDFViewer/Plugin.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.PDFViewer/Plugin.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using System.Runtime.ExceptionServices; using System.Windows.Threading; namespace QuickLook.Plugin.PDFViewer @@ -58,7 +59,7 @@ namespace QuickLook.Plugin.PDFViewer }), DispatcherPriority.Loaded).Wait(); if (exception != null) - throw exception; + ExceptionDispatchInfo.Capture(exception).Throw(); } public void Cleanup() diff --git a/QuickLook/MainWindowTransparent.xaml.cs b/QuickLook/MainWindowTransparent.xaml.cs index 734ccd7..8dafced 100644 --- a/QuickLook/MainWindowTransparent.xaml.cs +++ b/QuickLook/MainWindowTransparent.xaml.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; using System.IO; +using System.Runtime.ExceptionServices; using System.Windows; using System.Windows.Forms; using System.Windows.Threading; @@ -131,7 +132,7 @@ namespace QuickLook DispatcherPriority.Render).Wait(); if (thrown != null) - throw thrown; + ExceptionDispatchInfo.Capture(thrown).Throw(); } private void SetOpenWithButtonAndPath() diff --git a/QuickLook/ViewWindowManager.cs b/QuickLook/ViewWindowManager.cs index 51e808b..2b33f65 100644 --- a/QuickLook/ViewWindowManager.cs +++ b/QuickLook/ViewWindowManager.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; using System.IO; +using System.Runtime.ExceptionServices; using System.Windows; using System.Windows.Forms; using QuickLook.Helpers; @@ -202,7 +203,7 @@ namespace QuickLook } else { - throw; + ExceptionDispatchInfo.Capture(e).Throw(); } } }