This commit is contained in:
2022-12-16 06:01:23 +00:00
parent 26c2ae5cc9
commit effd96143f
310 changed files with 48715 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
using System;
using System.Text;
namespace Sockeye.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