using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XYY.Service.Standard.Finance.Charging.EUExchange
{
    public class EUExchangeException : Exception
    {
        /// <summary>
        /// 数据库连接错误
        /// </summary>
        public static readonly int DB_ConnectionError = 1000001;

        /// <summary>
        /// Redis连接错误
        /// </summary>
        public static readonly int Redis_ConnectionError = 1000002;

        /// <summary>
        /// 国家不存在汇率
        /// </summary>
        public static readonly int Redis_NoCountry = 1000003;


        /// <summary>
        /// 偏远表无数据
        /// </summary>
        public static readonly int Redis_NoData = 1000004;

        


        private int code { get; set; }

        private static Dictionary<int, String> msgMap = new Dictionary<int, String>();
        static EUExchangeException()
        {
            msgMap[DB_ConnectionError] = "数据库连接错误";
            msgMap[Redis_ConnectionError] = "Redis连接错误";
            msgMap[Redis_NoCountry] = "国家不存在汇率";
            msgMap[Redis_NoData] = "偏远表无数据";
        }
        public EUExchangeException(int exceptionCode) : base(msgMap[exceptionCode])
        {
            this.code = exceptionCode;
        }
    }
}
