error object
The error object interrogates the results of errors that are thrown or errors that are returned as part of asynchronous function calls.
The error object is available without an explicit
require('error') statement.try {
Integer.parseInt('string');
}
catch (error) {
session.output.write(
//English text message describing the failure that occurred.
"text: " + error.errorMessage + "\n" +
//message ID in hex string format.
"code: " + error.errorCode + "\n" +
//English help text describing what the error is and its cause.
"details: " + error.errorDescription + "\n" +
//English suggestion on how to resolve the error.
"to fix: " + error.errorSuggestion + "\n" +
//Backtrace listing the call stack leading up to the error.
"stack: " + error.stack + "\n"
);
}