using System;
using System.Collections.Generic;
using System.Text;
namespace YD_XinWei.Commons.Exceptions
{
///
/// 通过业务异常类
///
public class BizException : Exception
{
public string ErrorCode { get; } // 业务异常编号
public string ErrorMsg { get; }// 业务异常信息
public bool Success { get; set; } = false;
public IDictionary Infos { set; get; } // 业务异常详细信息
public BizException(string ErrorCode, string ErrorMsg) : base(ErrorMsg)
{
ErrorCode = ErrorCode;
ErrorMsg = ErrorMsg;
}
public BizException(string ErrorCode, string ErrorMsg, Exception e) : base(ErrorMsg, e)
{
ErrorCode = ErrorCode;
ErrorMsg = ErrorMsg;
}
public BizException(string ErrorMsg) : base(ErrorMsg)
{
ErrorCode = "-1";
ErrorMsg = ErrorMsg;
}
public BizException(string ErrorMsg, Exception e) : base(ErrorMsg, e)
{
ErrorCode = "-1";
ErrorMsg = ErrorMsg;
}
public BizException(Exception e)
{
ErrorCode = "-1";
ErrorMsg = e.Message;
}
}
}