using System;
namespace TShockAPI.Extensions
{
///
/// Extensions for Exceptions
///
public static class ExceptionExt
{
///
/// Builds a formatted string containing the messages of the given exception, and any inner exceptions it contains
///
///
///
public static string BuildExceptionString(this Exception ex)
{
string msg = ex.Message;
Exception inner = ex.InnerException;
while (inner != null)
{
msg += $"\r\n\t-> {inner.Message}";
inner = inner.InnerException;
}
return msg;
}
}
}