Log full exceptions

This commit is contained in:
2025-11-03 19:26:43 +09:00
parent a91dd6d034
commit 11a8fa381e
4 changed files with 26 additions and 3 deletions

View File

@ -0,0 +1,20 @@
using System.Text;
namespace Hcs.WebApp.Utils
{
public static class ExceptionExtensions
{
public static string CombineMessages(this Exception e)
{
var stringBuilder = new StringBuilder();
var currentException = e;
while (currentException != null)
{
stringBuilder.AppendLine(currentException.Message);
currentException = currentException.InnerException;
}
return stringBuilder.ToString();
}
}
}