error_list.h 4.3 KB

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