/
AstroJohn
/
MailRobot
Обзор
Документация
Войти
/
AstroJohn
/
MailRobot
Код
Запросы
0
Задачи
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Common/ExceptionExtensions.cs
27 строк
623 B
AstroJohn
1st commit
11 сен 2024, 13:31
11 сен 2024, 13:31
0f57dc5
Код
Авторство
О чём код?
using System; using System.Text; namespace Common { public static class ExceptionExtensions { public static string GetLoggingTrace(this Exception ex) { var result = new StringBuilder(512); while (ex != null) { if (result.Length > 0) result.AppendLine().AppendLine(); result.Append(ex.GetType().Name).Append(" : ").Append(ex.Message); result.AppendLine().Append(ex.StackTrace); ex = ex.InnerException; } return result.ToString(); } } }