namespace HoneyBox.Admin.Models.Common;

/// <summary>
/// 管理系统业务异常
/// </summary>
public class AdminException : Exception
{
    /// <summary>
    /// 错误码
    /// </summary>
    public int Code { get; }

    /// <summary>
    /// 创建业务异常
    /// </summary>
    /// <param name="code">错误码</param>
    /// <param name="message">错误消息</param>
    public AdminException(int code, string message) : base(message)
    {
        Code = code;
    }

    /// <summary>
    /// 创建业务异常
    /// </summary>
    /// <param name="code">错误码</param>
    /// <param name="message">错误消息</param>
    /// <param name="innerException">内部异常</param>
    public AdminException(int code, string message, Exception innerException) : base(message, innerException)
    {
        Code = code;
    }
}
