diff --git a/CefSharp.Core/Internals/CefTaskWrapper.h b/CefSharp.Core/Internals/CefTaskWrapper.h index 3ab38322d..7b8771ba9 100644 --- a/CefSharp.Core/Internals/CefTaskWrapper.h +++ b/CefSharp.Core/Internals/CefTaskWrapper.h @@ -25,8 +25,8 @@ namespace CefSharp // in order to report a .net exception from a CEF thread. static void ReportUnhanledException(Object ^state) { - String ^msg = dynamic_cast(state); - throw gcnew InvalidOperationException(msg); + Exception ^e = dynamic_cast(state); + throw gcnew InvalidOperationException(gcnew String(L"CefTaskWrapper caught an unexpected exception. This should never happen, please contact CefSharp for assistance."), e); } public: @@ -63,7 +63,7 @@ namespace CefSharp // with the exception. ThreadPool::UnsafeQueueUserWorkItem( gcnew WaitCallback(&CefTaskWrapper::ReportUnhanledException), - static_cast(msg)); + static_cast(e)); } };