error_list.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*************************************************************************/
  2. /* error_list.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* http://www.godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
  9. /* */
  10. /* Permission is hereby granted, free of charge, to any person obtaining */
  11. /* a copy of this software and associated documentation files (the */
  12. /* "Software"), to deal in the Software without restriction, including */
  13. /* without limitation the rights to use, copy, modify, merge, publish, */
  14. /* distribute, sublicense, and/or sell copies of the Software, and to */
  15. /* permit persons to whom the Software is furnished to do so, subject to */
  16. /* the following conditions: */
  17. /* */
  18. /* The above copyright notice and this permission notice shall be */
  19. /* included in all copies or substantial portions of the Software. */
  20. /* */
  21. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  22. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  23. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  24. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  25. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  26. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  27. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  28. /*************************************************************************/
  29. #ifndef ERROR_LIST_H
  30. #define ERROR_LIST_H
  31. /** Error List. Please never compare an error against FAILED
  32. * Either do result != OK , or !result. This way, Error fail
  33. * values can be more detailed in the future.
  34. *
  35. * This is a generic error list, mainly for organizing a language of returning errors.
  36. */
  37. enum Error {
  38. OK,
  39. FAILED, ///< Generic fail error
  40. ERR_UNAVAILABLE, ///< What is requested is unsupported/unavailable
  41. ERR_UNCONFIGURED, ///< The object being used hasnt been properly set up yet
  42. ERR_UNAUTHORIZED, ///< Missing credentials for requested resource
  43. ERR_PARAMETER_RANGE_ERROR, ///< Parameter given out of range (5)
  44. ERR_OUT_OF_MEMORY, ///< Out of memory
  45. ERR_FILE_NOT_FOUND,
  46. ERR_FILE_BAD_DRIVE,
  47. ERR_FILE_BAD_PATH,
  48. ERR_FILE_NO_PERMISSION, // (10)
  49. ERR_FILE_ALREADY_IN_USE,
  50. ERR_FILE_CANT_OPEN,
  51. ERR_FILE_CANT_WRITE,
  52. ERR_FILE_CANT_READ,
  53. ERR_FILE_UNRECOGNIZED, // (15)
  54. ERR_FILE_CORRUPT,
  55. ERR_FILE_EOF,
  56. ERR_CANT_OPEN, ///< Can't open a resource/socket/file
  57. ERR_CANT_CREATE,
  58. ERROR_QUERY_FAILED, // (20)
  59. ERR_ALREADY_IN_USE,
  60. ERR_LOCKED, ///< resource is locked
  61. ERR_TIMEOUT,
  62. ERR_CANT_CONNECT,
  63. ERR_CANT_RESOLVE, // (25)
  64. ERR_CONNECTION_ERROR,
  65. ERR_CANT_AQUIRE_RESOURCE,
  66. ERR_CANT_FORK,
  67. ERR_INVALID_DATA, ///< Data passed is invalid
  68. ERR_INVALID_PARAMETER, ///< Parameter passed is invalid (30)
  69. ERR_ALREADY_EXISTS, ///< When adding, item already exists
  70. ERR_DOES_NOT_EXIST, ///< When retrieving/erasing, it item does not exist
  71. ERR_DATABASE_CANT_READ, ///< database is full
  72. ERR_DATABASE_CANT_WRITE, ///< database is full
  73. ERR_COMPILATION_FAILED, // (35)
  74. ERR_METHOD_NOT_FOUND,
  75. ERR_LINK_FAILED,
  76. ERR_SCRIPT_FAILED,
  77. ERR_CYCLIC_LINK,
  78. ERR_INVALID_DECLARATION, // (40)
  79. ERR_DUPLICATE_SYMBOL,
  80. ERR_PARSE_ERROR,
  81. ERR_BUSY,
  82. ERR_SKIP,
  83. ERR_HELP, ///< user requested help!! (45)
  84. ERR_BUG, ///< a bug in the software certainly happened, due to a double check failing or unexpected behavior.
  85. ERR_PRINTER_ON_FIRE, /// the parallel port printer is engulfed in flames
  86. ERR_OMFG_THIS_IS_VERY_VERY_BAD, ///< shit happens, has never been used, though
  87. ERR_WTF = ERR_OMFG_THIS_IS_VERY_VERY_BAD ///< short version of the above
  88. };
  89. #endif