ErrorCode.h 974 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // Copyright @ 2014 Hangzhou Topzen Ltd.
  3. // Author: Tang (tang@hztopzen.com) @ 2014-12
  4. //
  5. #ifndef __ERRORCODE_H
  6. #define __ERRORCODE_H
  7. #include "BaseTypes.h"
  8. #include "BaseHeaders.h"
  9. namespace tzc {
  10. // Error Code:
  11. //
  12. // |--------|--------|
  13. // class code
  14. //
  15. // class:
  16. // 01 - common error
  17. // 02 - epoll error
  18. // ... ....
  19. //
  20. enum __ErrorCode {
  21. E_OK = 0x0000,
  22. E_FAILED = -0x0001, // common failed
  23. E_INVTYPE = -0x1001, // invalid type
  24. E_INVPARAM = -0x1002, // invalid parameter
  25. E_INVVALUE = -0x1003, // invalid value. eg. invalid ipaddress
  26. E_UNSUPPORT = -0x1004, // unsupported implementation
  27. E_CREATEFAIL = -0x2001,
  28. E_ADDFAIL = -0x2002,
  29. E_MODIFYFAIL = -0x2003,
  30. E_DELETEFAIL = -0x2004,
  31. E_WAITFAIL = -0x2005,
  32. E_IOEVENTEXIST = -0x2006,
  33. E_IOEVENTNOTFOUND = -0x2007,
  34. };
  35. std::string ErrorStringCN(TZ_Int32 errcode);
  36. std::string ErrorStringEN(TZ_Int32 errcode);
  37. }; // namespace tzc
  38. #endif /* ----- #ifndef __ERRORCODE_H ----- */