diff options
Diffstat (limited to 'proxies/exception_extensions.cs')
| -rw-r--r-- | proxies/exception_extensions.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/proxies/exception_extensions.cs b/proxies/exception_extensions.cs new file mode 100644 index 0000000..e832bfb --- /dev/null +++ b/proxies/exception_extensions.cs @@ -0,0 +1,18 @@ +using System;
+using System.Reflection;
+
+namespace proxies
+{
+ public static class exception_extensions
+ {
+ private static readonly MethodInfo preserveStackTrace =
+ typeof (Exception).GetMethod("InternalPreserveStackTrace",
+ BindingFlags.NonPublic | BindingFlags.Instance);
+
+ public static Exception PreserveStackTrace(this Exception exception)
+ {
+ preserveStackTrace.Invoke(exception, new object[0]);
+ return exception;
+ }
+ }
+}
\ No newline at end of file |
