/// <summary> /// Gets the <see cref="StackTraceInformation"/> for an exception. /// </summary> /// <param name="exception">An <see cref="Exception"/> instance.</param> /// <returns>StackTraceInformation for the exception</returns> internal static StackTraceInformation TryGetStackTraceInformation(this Exception exception) { if (!string.IsNullOrEmpty(exception?.StackTrace)) { return(StackTraceHelper.CreateStackTraceInformation(exception, false, exception.StackTrace)); } return(null); }