• Downloading & Installing
• Running
• Examples
Cryptography
• hashSHA256
• hmacSHA256
• hashSHA512
• hmacSHA512
• hashMD5
• hmacMD5
File System
• fileExists
• fileRead
• fileWrite
• folderExists
• unzip
• zip
Networking
• curlExecute
• nsapiExecute
Operating System
• shellExecute
Text Encoding
• base64Decode
• base64Encode
Utilities
• abort / halt / quit
• info
• infoRefresh
• sleep
• stringIndent
• uuidGenerate
Suite.js includes features that are designed to help you manage errors that occur when your JavaScript code is initially being parsed and when it is running.
When a standard JavaScript exception occurs, Suite.js provides as much information as it can about the error, including an error number (when available), a description of the error, as well as the full JavaScript file that was being interpreted (including any "included" files). Note that if an error occurs when an encrypted source file is executed, no JavaScript source is exposed.
For example, consider this very simple JavaScript file.
var x = foo( 999 );
When the file is run, the following output is generated.
Error: • Number: 0 • Message: uncaught: 'identifier "foo" undefined' • JavaScript: 1: var x = foo( 999 );
This indicates that the JavaScript engine encountered an error. In this case, the error occurred because a reference to "foo" could not be resolved.
Suite.js supports standard JavaScript try...catch statements. This gives you the ability to handle exceptions that occur within a specific block of code.
Continuing with the example above, here's the code wrapped in a try...catch statement.
try { var x = foo( 999 ); } catch (e) { writeln( "Error: " + e.message ); }
When the modified file is run, the following output is generated.
Error: identifier 'foo' undefined
In some cases, Suite.js will encounter errors that cause the entire runtime to crash. These "unhandled exceptions" will cause an "UnhandledException" event to occur, and the runtime will terminate.
For example, consider this JavaScript file, which intentionally causes a "divide by zero" error.
var a = 100; var b = a / 0; writeln( b );
When the file is run, the following output is generated.
UnhandledException: • Error Number: 0 • Message: root{"error"}{"params"}[0]: Floating point infinity is not a valid JSON value Exception Message: root{"error"}{"params"}[0]: Floating point infinity is not a valid JSON value Exception Error Number: 0 An exception of class JSONException was not handled. The application must shut down.
When the error occurs, Suite.js cannot recover from it. The app shuts down.
The curlExecute function has been designed with additional error handling capabilities. For example, if cURL itself encounters an error, such as an invalid host name being referenced, it will return both an error code and error message in its response. If the host itself returns an error (such as a "404 Not Found" error), then the error will be available via the cURL response object (as the "responseCode" attribute).
For additional information, see the curlExecute documentation.
© Copyright 2025 Tim Dietrich. | Legal Info