internal static TException SetCallStack <TException>(this TException ex, FullExceptionStackTrace fullExceptionStackTrace) where TException : Exception { if (ex.GetNamedProperty(InternalExceptionExtensions.FullExceptionStackTraceLabel).FirstOrDefault() != null) { return(ex); // We never set stack trace more than once } return(ex.AddNamedProperty(FullExceptionStackTraceLabel, new FullExceptionStackTrace(ex))); }
internal static string GetFullStackTrace(this Exception ex) { FullExceptionStackTrace fullExceptionStackTrace = ex.GetCallStack(); if (fullExceptionStackTrace == null) { fullExceptionStackTrace = new FullExceptionStackTrace(ex); ex.SetCallStack(fullExceptionStackTrace); } return(fullExceptionStackTrace.ToString()); }