errors.dart 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. class Errors {
  2. Errors._();
  3. // APP 本地错误代码
  4. static const String ePlatform = '-100';
  5. static const String eApiBase = '-101';
  6. static const String eNoAvailableApi = '-102';
  7. static const String eNoConnectivity = '-103';
  8. static const String eFingerprint = '-104';
  9. static const String eReadLog = '-201';
  10. static const String eUploadLog = '-202';
  11. // 通用错误代码
  12. static const String eForbidden = '-1';
  13. // 用户被禁用
  14. static const int eUserDisabled = 424;
  15. // 设备被禁用
  16. static const int eDeviceRestricted = 423;
  17. // 当前区域不可用
  18. static const int eRegionNotAvailable = 403;
  19. // token实效
  20. static const int eTokenExpired = 401;
  21. // VPN 错误代码(500-599)
  22. static const int eMethodCall = 400;
  23. static const int eVpnUserAuth = 500; //用户未授权
  24. static const int eVpnUserStatus = 501; //用户被禁用或者是需续费
  25. static const int eVpnMaxDevice = 502; //设备数到上限
  26. static const int eVpnConnectServer = 503; //连接服务器失败
  27. static const int eVpnRedisReadError = 504; //Redis读取错误,无法获得用户信息
  28. static const int eVpnIpRegion = 505; //IP地区不一致
  29. static const int eVpnUserExpire = 506; //用户过期
  30. static const int eVpnUserLevelError = 507; //会员级别不一致
  31. static const int eVpnServerOverload = 508; //服务器负载上限
  32. static const int eVpnNoServer = 509; //没有服务器
  33. static const int eVpnInvalidDeviceId = 510; //用户账号下不存在该设备Id
  34. static const int eVpnTrialTimeLimited = 511; //试用时长上限
  35. static const int eVpnTellRetry = 512; //重试错误
  36. static const int eVpnBadParam = 513; //参数错误
  37. static const int eVpnConnectRouter = 514; //连接router超时
  38. static const int eVpnInit = 515; //初始化失败
  39. // 自定义错误码
  40. static const int eVpnServerKilled = 1111; // 服务器异常kill
  41. static const int eVpnAutoStop = 1112; // 开启vpn时切换后台自动关闭
  42. static const int eVpnNotPermission = 1113; // vpn没有授权
  43. // VPN 错误代码文字描述
  44. static const Map<int, String> vpnErrorTexts = {
  45. eMethodCall: '接口方法调用失败',
  46. eVpnUserAuth: '用户未授权',
  47. eVpnUserStatus: '用户被禁用或者是需续费',
  48. eVpnMaxDevice: '设备数到上限',
  49. eVpnConnectServer: '连接服务器失败',
  50. eVpnRedisReadError: 'Redis读取错误无法获得用户信息',
  51. eVpnIpRegion: 'IP地区不一致',
  52. eVpnUserExpire: '用户过期',
  53. eVpnUserLevelError: '会员级别不一致',
  54. eVpnServerOverload: '服务器负载上限',
  55. eVpnNoServer: '没有服务器',
  56. eVpnInvalidDeviceId: '用户账号下不存在该设备Id',
  57. eVpnTrialTimeLimited: '试用时长上限',
  58. eVpnTellRetry: '重试错误',
  59. eVpnBadParam: '参数错误',
  60. eVpnConnectRouter: '连接route失败',
  61. eVpnInit: '初始化失败',
  62. eVpnServerKilled: '服务器异常kill',
  63. };
  64. // Subscribe 错误代码
  65. static const String eQueryProduct = '600';
  66. static const String ePurchaseSubscription = '601';
  67. static const String eRestoreSubscription = '602';
  68. static const String eVerifyPurchase = '604';
  69. }