|
|
|
@ -0,0 +1,26 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace InvoicePlat.Common.Helper
|
|
|
|
|
{
|
|
|
|
|
public static class ExceptionFormatHelper
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 自定义返回格式
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="throwMsg"></param>
|
|
|
|
|
/// <param name="ex"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static string Format(string throwMsg, Exception ex)
|
|
|
|
|
{
|
|
|
|
|
return string.Format(@"
|
|
|
|
|
【自定义错误】:{0}
|
|
|
|
|
【异常类型】:{1}
|
|
|
|
|
【异常信息】:{2}
|
|
|
|
|
【堆栈调用】:{3}", [throwMsg, ex.GetType().Name, ex.Message, ex.StackTrace]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|