添加项目文件。
This commit is contained in:
46
QYZH.InteractiveMagazine.Models/Common/BusinessException.cs
Normal file
46
QYZH.InteractiveMagazine.Models/Common/BusinessException.cs
Normal file
@ -0,0 +1,46 @@
|
||||
namespace QYZH.InteractiveMagazine.Models.Common;
|
||||
|
||||
/// <summary>
|
||||
/// 业务异常类
|
||||
/// </summary>
|
||||
public class BusinessException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// 错误码
|
||||
/// </summary>
|
||||
public int Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 无参构造函数
|
||||
/// </summary>
|
||||
public BusinessException() : base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="message">异常消息</param>
|
||||
public BusinessException(string message) : base(message)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="message">异常消息</param>
|
||||
/// <param name="code">错误码</param>
|
||||
public BusinessException(string message, int code) : base(message)
|
||||
{
|
||||
Code = code;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="message">异常消息</param>
|
||||
/// <param name="innerException">内部异常</param>
|
||||
public BusinessException(string message, Exception innerException) : base(message, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user