This commit is contained in:
2018-06-28 23:41:48 +00:00
commit 515bd37952
256 changed files with 29890 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
using System;
using System.Text;
namespace AyaNova.Util
{
internal static class ExceptionUtil
{
/// <summary>
/// Extract and return exception message
/// Handles innermost exceptions level by level
/// </summary>
/// <param name="ex"></param>
/// <returns></returns>
public static string ExtractAllExceptionMessages(Exception ex)
{
StringBuilder sb = new StringBuilder();
while (ex != null)
{
sb.AppendLine($"{ex.Source} -> {ex.Message}");
ex = ex.InnerException;
}
return sb.ToString();
}
}//eoc
}//eons