1 /*************************************************************************/ 2 /* error_list.h */ 3 /*************************************************************************/ 4 /* This file is part of: */ 5 /* GODOT ENGINE */ 6 /* https://godotengine.org */ 7 /*************************************************************************/ 8 /* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ 9 /* Copyright (c) 2014-2019 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 33 /** Error List. Please never compare an error against FAILED 34 * Either do result != OK , or !result. This way, Error fail 35 * values can be more detailed in the future. 36 * 37 * This is a generic error list, mainly for organizing a language of returning errors. 38 */ 39 40 enum Error { 41 OK, 42 FAILED, ///< Generic fail error 43 ERR_UNAVAILABLE, ///< What is requested is unsupported/unavailable 44 ERR_UNCONFIGURED, ///< The object being used hasnt been properly set up yet 45 ERR_UNAUTHORIZED, ///< Missing credentials for requested resource 46 ERR_PARAMETER_RANGE_ERROR, ///< Parameter given out of range (5) 47 ERR_OUT_OF_MEMORY, ///< Out of memory 48 ERR_FILE_NOT_FOUND, 49 ERR_FILE_BAD_DRIVE, 50 ERR_FILE_BAD_PATH, 51 ERR_FILE_NO_PERMISSION, // (10) 52 ERR_FILE_ALREADY_IN_USE, 53 ERR_FILE_CANT_OPEN, 54 ERR_FILE_CANT_WRITE, 55 ERR_FILE_CANT_READ, 56 ERR_FILE_UNRECOGNIZED, // (15) 57 ERR_FILE_CORRUPT, 58 ERR_FILE_MISSING_DEPENDENCIES, 59 ERR_FILE_EOF, 60 ERR_CANT_OPEN, ///< Can't open a resource/socket/file 61 ERR_CANT_CREATE, // (20) 62 ERROR_QUERY_FAILED, 63 ERR_ALREADY_IN_USE, 64 ERR_LOCKED, ///< resource is locked 65 ERR_TIMEOUT, 66 ERR_CANT_CONNECT, // (25) 67 ERR_CANT_RESOLVE, 68 ERR_CONNECTION_ERROR, 69 ERR_CANT_AQUIRE_RESOURCE, 70 ERR_CANT_FORK, 71 ERR_INVALID_DATA, ///< Data passed is invalid (30) 72 ERR_INVALID_PARAMETER, ///< Parameter passed is invalid 73 ERR_ALREADY_EXISTS, ///< When adding, item already exists 74 ERR_DOES_NOT_EXIST, ///< When retrieving/erasing, it item does not exist 75 ERR_DATABASE_CANT_READ, ///< database is full 76 ERR_DATABASE_CANT_WRITE, ///< database is full (35) 77 ERR_COMPILATION_FAILED, 78 ERR_METHOD_NOT_FOUND, 79 ERR_LINK_FAILED, 80 ERR_SCRIPT_FAILED, 81 ERR_CYCLIC_LINK, // (40) 82 ERR_INVALID_DECLARATION, 83 ERR_DUPLICATE_SYMBOL, 84 ERR_PARSE_ERROR, 85 ERR_BUSY, 86 ERR_SKIP, // (45) 87 ERR_HELP, ///< user requested help!! 88 ERR_BUG, ///< a bug in the software certainly happened, due to a double check failing or unexpected behavior. 89 ERR_PRINTER_ON_FIRE, /// the parallel port printer is engulfed in flames 90 ERR_OMFG_THIS_IS_VERY_VERY_BAD, ///< shit happens, has never been used, though 91 ERR_WTF = ERR_OMFG_THIS_IS_VERY_VERY_BAD ///< short version of the above 92 }; 93 94 #endif 95