AutomationDrivers.Core.Exceptions.AutomationDriverException.PreserveStackTrace C# (CSharp) Method

PreserveStackTrace() private static method

private static PreserveStackTrace ( Exception e ) : void
e System.Exception
return void
        private static void PreserveStackTrace(Exception e)
        {
            var ctx = new StreamingContext(StreamingContextStates.CrossAppDomain);
            var mgr = new ObjectManager(null, ctx);
            var si = new SerializationInfo(e.GetType(), new FormatterConverter());

            e.GetObjectData(si, ctx);
            mgr.RegisterObject(e, 1, si);
            mgr.DoFixups();
        }