From 1bf448dd8713dd0524966096ba198bdb077fe998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 27 Jun 2019 12:35:55 +0200 Subject: Properly expose all Error constants to scripting languages --- doc/classes/@GlobalScope.xml | 117 +++++++++++++++++++++++++++---------------- 1 file changed, 75 insertions(+), 42 deletions(-) (limited to 'doc/classes') diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 1c3b6cba70..df98048a97 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -1137,127 +1137,160 @@ - Functions that return Error return OK when no error occurred. Most functions don't return errors and/or just print errors to STDOUT. + Methods that return [enum Error] return [constant OK] when no error occurred. Note that many functions don't return an error code but will print error messages to stdout. + Since [constant OK] has value 0, and all other failure codes are positive integers, it can also be used in boolean checks, e.g.: + [codeblock] + var err = method_that_returns_error() + if (err != OK): + print("Failure!) + # Or, equivalent: + if (err): + print("Still failing!) + [/codeblock] Generic error. - Unavailable error + Unavailable error. - Unconfigured error + Unconfigured error. - Unauthorized error + Unauthorized error. - Parameter range error + Parameter range error. - Out of memory (OOM) error + Out of memory (OOM) error. - File: Not found error + File: Not found error. - File: Bad drive error + File: Bad drive error. - File: Bad path error + File: Bad path error. - File: No permission error + File: No permission error. - File: Already in use error + File: Already in use error. - File: Can't open error + File: Can't open error. - File: Can't write error + File: Can't write error. - File: Can't read error + File: Can't read error. - File: Unrecognized error + File: Unrecognized error. - File: Corrupt error + File: Corrupt error. - File: Missing dependencies error + File: Missing dependencies error. - File: End of file (EOF) error + File: End of file (EOF) error. - Can't open error + Can't open error. - Can't create error - - - Parse error + Can't create error. - Query failed error + Query failed error. - Already in use error + Already in use error. - Locked error + Locked error. - Timeout error + Timeout error. + + + Can't connect error. + + + Can't resolve error. + + + Connection error. - Can't acquire resource error + Can't acquire resource error. + + + Can't fork process error. - Invalid data error + Invalid data error. - Invalid parameter error + Invalid parameter error. - Already exists error + Already exists error. - Does not exist error + Does not exist error. - Database: Read error + Database: Read error. - Database: Write error + Database: Write error. - Compilation failed error + Compilation failed error. - Method not found error + Method not found error. - Linking failed error + Linking failed error. - Script failed error + Script failed error. - Cycling link (import cycle) error + Cycling link (import cycle) error. + + + Invalid declaration error. + + + Duplicate symbol error. + + + Parse error. - Busy error + Busy error. + + + Skip error. - Help error + Help error. - Bug error + Bug error. + + + Printer on fire error. (This is an easter egg, no engine methods return this error code.) No hint for edited property. -- cgit v1.2.3