diff options
| author | mo k <mo@mokhan.ca> | 2012-05-03 12:44:39 -0600 |
|---|---|---|
| committer | mo k <mo@mokhan.ca> | 2012-05-03 12:44:39 -0600 |
| commit | 2ea2730e65af8e7849c6f36443f87e8731ffd5be (patch) | |
| tree | 3b9455098690e0038d0f04754b4c34a91cd34162 /proxies/exception_extensions.cs | |
initial checkin.main
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 |
