ErrorCode.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. #ifndef __ERROR_CODE_H
  2. #define __ERROR_CODE_H
  3. #pragma once
  4. /** two level error,the range between (0,0x1ff) is common error,it can recover anther is system level error and can't be recover */
  5. enum ErrorCodeEnum
  6. {
  7. Error_Succeed=0,
  8. //data check's category
  9. Error_DataCheck=100, //mark the beginning for this category
  10. Error_Null, //the error of a null pointer
  11. Error_Param, //the error of a illegal parameter
  12. Error_Overflow, //The length or range overflow
  13. Error_TooSmallBuffer, // buffer too small
  14. Error_NotIntegrated, //The package or result is not intergrated
  15. Error_CheckSum, //Check sum is not the same
  16. Error_MisMatched, //the expression is mismatching
  17. Error_Deprecated, //the function is deprecated
  18. //Target being's category(512)
  19. Error_TargetBeing=0x200,
  20. Error_NoTarget, //request target is not exist
  21. Error_NoDefine, //The class or object no define
  22. Error_NotImpl, //the method has not implement yet
  23. Error_NotExist, //not exist
  24. Error_Duplication, //Duplicate action or object
  25. Error_Unregisted, //exist but the object has not registered
  26. Error_AlreadyExist, //already exist
  27. Error_MethodNotFound, //method does not exist
  28. Error_Redirect, // redirect indication
  29. Error_BridgeNotBind, // bridge bind indication
  30. Error_BridgeNotOK, // try bridge fail
  31. Error_NotSupport, // don't support the request
  32. Error_NotConfig, /** The dream configuration is unsettled*/
  33. //Entity state's category
  34. Error_InvalidState=0x300, //state is not valid for current call
  35. Error_NotInit, //The target is not be initial
  36. Error_Paused, //the access object is in Pause state
  37. Error_Stoped, //the access object is in Stop state
  38. Error_Losted, //the access object is in Lost state
  39. Error_Closed, //opposite side in close state
  40. Error_Accept, //test mode: pass the test
  41. Error_Failed, //test mode: fail to pass the test.
  42. Error_Busy, //the access object is busy doing
  43. //Framework Task control's category
  44. Error_TaskControl=0x400,
  45. Error_Pending, //The request in not finish
  46. Error_Cancel, //The process is be cancel by framework
  47. Error_Break, //The task has interrupt
  48. Error_NotMeetCondition, //not meat run condition,run cancel
  49. Error_NoPrivilege, //no privilege
  50. Error_MethodSignatureFailed, //method signature failed
  51. //opposite side action's category
  52. Error_PeerAction=0x500,
  53. Error_PeerClose, //peer close request
  54. Error_PeerIgnore, //peer did not answer before the ITransactionContext object release
  55. Error_PeerReject, //The another side reject the request
  56. Error_PeerDelay, //The task can not run right now,will be deley to set time
  57. //process fail's category
  58. Error_Process=0x600,
  59. Error_NetBroken, //the network is broken
  60. Error_UpdateFailed, //system update failed
  61. Error_RegistryFailed, //registry operation failed
  62. Error_IO, //IO error(file reading/writing)
  63. Error_Readonly, //The object can't be edit
  64. Error_TimeOut=0x700,
  65. Error_BlockTimeOut, //WaitAnswer time out
  66. Error_ThreadTimeOut, //Max Thread run time
  67. Error_QueueTimeOut, //Task wait time out in queue
  68. Error_ReplyTimeOut, //The system max answer time
  69. Error_Hardware=0x800,
  70. Error_DevLoadFileFailed, //load dll or config file failed
  71. Error_DevNotAvailable, //device not connected
  72. Error_DevAlreadyConnected, //device already connected
  73. Error_DevConnFailed, //connect to device failed
  74. Error_DevCommFailed, //Communication failed between HOST and Device
  75. Error_DevMedia, //Media error(Data lack,unrecognized and so on)
  76. Error_EnvCamera, //EnvCamera error
  77. Error_OptCamera, //OptCamera error(Data lack,unrecognized and so on)
  78. Error_AllCamera, //AllCamera error(Data lack,unrecognized and so on)
  79. Error_EwsCamera, //EwsCamera error(Data lack,unrecognized and so on)
  80. Error_AudioIN,
  81. Error_AudioOut,
  82. Error_DevFailAddUp, //Number of errors reach to the limit
  83. Error_Interact,
  84. Error_Dev_HookNotAtPos, //钩子未归位
  85. Error_Dev_Offline, //设备掉线
  86. Error_Dev_CmdUnableExecute, //命令不可执行
  87. Error_Dev_HopperHasNoCard, //卡箱无卡
  88. Error_Dev_HopperMissing, //发卡箱缺失
  89. Error_Dev_TransCarJammed, //传输小车堵塞
  90. Error_Dev_RetainBinFull, //回收箱满
  91. Error_Dev_RetainBinMissing, //回收箱缺失
  92. Error_Dev_CardInReader, //读卡器内有卡
  93. Error_Dev_SlotHasNoCard, //卡槽内无卡
  94. Error_Dev_CardInSlot, //卡槽内有卡
  95. Error_Dev_NoCardInReader, //读卡器内无卡
  96. Error_Dev_CardJammed, //塞卡
  97. Error_Dev_SlotJammed, //卡槽堵塞
  98. Error_Dev_SlotInvalid, //卡槽地址非法(越界等)
  99. Error_Dev_IDCardNotFound, // 未检测到身份证
  100. Error_MaintainRequired, //Device breakdown and in need of repair.
  101. //Socket Type Error
  102. Error_Socket = 0x900,
  103. Error_ConnectFailed,
  104. Error_ServerNotAvailable,
  105. Error_Debug=0xf00,
  106. Error_Assert,
  107. Error_Trace,
  108. Error_Bug, //bug detected
  109. /*
  110. // device error code x define at range 0x00010000 <= x <= 0x0001ffff
  111. //
  112. Error_Device_Begin = 0x00010000,
  113. //...... device error codes goes here
  114. Error_Device_End = 0x0001ffff,
  115. */
  116. Error_Unrecover=0x70000000, //less than this means can recovery, while great than this means fatal and need reboot
  117. Error_Resource, //The system resource ec:memory/handle/space,do not retry,should restart system
  118. Error_NewProcess, //start process failed
  119. Error_FailVerify, //Signature verification failed of entity
  120. Error_Block, //The thread block and the module hold
  121. Error_Exception, //except throw
  122. Error_Unexpect=0x7ffffffe, //the fail reason is not expect
  123. Error_IgnoreAll=0x7fffffff // for special internal usage only, user dont use this code
  124. };
  125. #define ERR_(e) #e
  126. #endif // __ERROR_CODE_H