bBox_LastError( reference )

Parameters:
   reference: session reference


Result:
   one or more return delimited values


Error:
   none


Script Step:
   none

––––––––––

First appeared in: 0.50

Examples in demo file: 0

Compatibility:   Client, Server, Ubuntu, WebDirect, WPE

––––––––––

If no error, a result of "0" is returned.

When there is an error, many calls will return just a numeric code for the first value, followed by one or more lines with a descriptive error message or stack trace.

Results from this function are “session safe”, so it will reliably work when multiple server-side PSoS or scheduled scripts are running. However, except with SQLite functions, they are not thread safe, so certain scenarios such as recursion could result in the wrong error result being returned. Error codes are not cleared by this call, so it may be called multiple times.

Often the numeric error codes returned are the same as the underlying binary. In other words, bBox_Curl will often return the same result as the curl command when run in the Terminal.

A few commands used by bBox will may return error output or status via stderr (the alternate output pipe used by POSIX commands), which is normally ignored by bBox. If this output is needed, such as when debugging Python scripts, add 32 to your mode value to combine stdout & stderr output of the command.

The reference values to use are the following:

• bBox_Bash, bBox_Shell, bBox_Zsh, bBox_File*, bBox_JQ, bBox_Python3Run: use "posix"

• bBox_ExecuteSQL: use "executesql"

• bBox_Python (but not bBox_Python3Run): use -3

• bBox_XPathInitializeFromText: use "xpath"

• bBox_JavaScript or bBox_JavaScriptNode: use "js"

• bBox_Applescript: use "applescript"

• bBox_Curl: use "curl"

• bBox_Pasteboard*, bBox_GetCharacterStyle: "util"

• bBox_SQLite: use reference number returned after open, exec, or close functions (this will be a positive number)

––––––––––

bBox Functions

bBox Wiki