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