aboutsummaryrefslogtreecommitdiff
path: root/game/addons/zylann.hterrain/util/errors.gd
blob: c6a2c63603ab629cf866f500727fa85d65693511 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@tool

# Taken from https://docs.godotengine.org/en/3.0/classes/class_@globalscope.html#enum-globalscope-error
const _names = {
   OK: "ok",
   FAILED: "Generic error.",
   ERR_UNAVAILABLE: "Unavailable error",
   ERR_UNCONFIGURED: "Unconfigured error",
   ERR_UNAUTHORIZED: "Unauthorized error",
   ERR_PARAMETER_RANGE_ERROR: "Parameter range error",
   ERR_OUT_OF_MEMORY: "Out of memory (OOM) error",
   ERR_FILE_NOT_FOUND: "File Not found error",
   ERR_FILE_BAD_DRIVE: "File Bad drive error",
   ERR_FILE_BAD_PATH: "File Bad path error",
   ERR_FILE_NO_PERMISSION: "File No permission error",
   ERR_FILE_ALREADY_IN_USE: "File Already in use error",
   ERR_FILE_CANT_OPEN: "File Can't open error",
   ERR_FILE_CANT_WRITE: "File Can't write error",
   ERR_FILE_CANT_READ: "File Can't read error",
   ERR_FILE_UNRECOGNIZED: "File Unrecognized error",
   ERR_FILE_CORRUPT: "File Corrupt error",
   ERR_FILE_MISSING_DEPENDENCIES: "File Missing dependencies error",
   ERR_FILE_EOF: "File End of file (EOF) error",
   ERR_CANT_OPEN: "Can't open error",
   ERR_CANT_CREATE: "Can't create error",
   ERR_QUERY_FAILED: "Query failed error",
   ERR_ALREADY_IN_USE: "Already in use error",
   ERR_LOCKED: "Locked error",
   ERR_TIMEOUT: "Timeout error",
   ERR_CANT_CONNECT: "Can't connect",
   ERR_CANT_RESOLVE: "Can't resolve",
   ERR_CONNECTION_ERROR: "Connection error",
   ERR_CANT_ACQUIRE_RESOURCE: "Can't acquire resource error",
   ERR_CANT_FORK: "Can't fork",
   ERR_INVALID_DATA: "Invalid data error",
   ERR_INVALID_PARAMETER: "Invalid parameter error",
   ERR_ALREADY_EXISTS: "Already exists error",
   ERR_DOES_NOT_EXIST: "Does not exist error",
   ERR_DATABASE_CANT_READ: "Database Read error",
   ERR_DATABASE_CANT_WRITE: "Database Write error",
   ERR_COMPILATION_FAILED: "Compilation failed error",
   ERR_METHOD_NOT_FOUND: "Method not found error",
   ERR_LINK_FAILED: "Linking failed error",
   ERR_SCRIPT_FAILED: "Script failed error",
   ERR_CYCLIC_LINK: "Cycling link (import cycle) error",
   ERR_INVALID_DECLARATION: "Invalid declaration",
   ERR_DUPLICATE_SYMBOL: "Duplicate symbol",
   ERR_PARSE_ERROR: "Parse error",
   ERR_BUSY: "Busy error",
   ERR_SKIP: "Skip error",
   ERR_HELP: "Help error",
   ERR_BUG: "Bug error",
   ERR_PRINTER_ON_FIRE: "The printer is on fire"
}

static func get_message(err_code: int):
   return str("[", err_code, "]: ", _names[err_code])