public void Constructor_PrivateException_TypeIsPrivateException() { var exception = new PrivateException(); var sentryException = new SentryException(exception); Assert.That(sentryException.Type, Is.EqualTo("SharpRaven.UnitTests.Data.PrivateException")); }
public static void Rethrow(this Exception ex) { //#if NET45 // ExceptionDispatchInfo.Capture(ex).Throw(); //#elif MONO // //Mono version here. //#else // var keepStackTrack = typeof(Exception).GetMethod("PrepForRemoting", BindingFlags.Instance | BindingFlags.NonPublic) // ?? typeof(Exception).GetMethod("InternalPreserveStackTrace", BindingFlags.Instance | BindingFlags.NonPublic); // keepStackTrack.Invoke(ex, new object[0]); // throw ex; //#endif var e = new PrivateException(ex); throw e.InnerException; }