using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace YuanXuan.IM.Common.Exceptions { /// /// 业务异常 /// public class BusinessException : Exception { public BusinessExceptionCode ErrorCode { get; private set; } public object BussinessExceptionData { get; private set; } public BusinessException(string message, object friendlyData = null, BusinessExceptionCode errorCode = BusinessExceptionCode.BussinessError) : base(message) { ErrorCode = errorCode; BussinessExceptionData = friendlyData; } } /// /// 业务异常码 /// public enum BusinessExceptionCode { /// /// 业务异常码 /// BussinessError = 1000, /// /// 程序异常码 /// AppError = 500, /// /// 访问令牌异常码 /// AccessTokenError = 401, /// /// 访问令牌被顶号异常码 /// AccessTokenTopNumberError = 402, } }