using System;

namespace StaffManagement.Extensions
{
    /// <summary>
    /// 表示请求错误，服务器无法处理
    /// </summary>
    public class ApiException:Exception
    {
        public object Param { get; set; }

        /// <summary>
        /// 通过提供异常信息，返回api错误异常
        /// </summary>
        /// <param name="msg">错误消息</param>
        public ApiException(string msg) : base(msg) {
            this.Param = null;
        }

        /// <summary>
        /// 通过提供异常信息，返回api错误异常
        /// </summary>
        /// <param name="msg">错误消息</param>
        /// <param name="param">请求绑定参数</param>
        public ApiException(object param,string msg) : base(msg) {
            this.Param = param;
        }
    }
}
