The variable in a catch statement is of the Error type or one of its subclasses. You can raise exceptions with a throw statement:
- throw "This is my exception message!";
- throw new RangeError("Var x is not between 1 and 100");
Uncaught exceptions inside a connector result in an error status for the processed message.
Syntax (Exception Handling) | Example |
---|
try {
// Code to execute
} catch (exception) {
// Exception handling
// code to execute
} finally {
// Code to always execute
}
| try {
var x = undefinedVarName;
} catch (e) {
logger.error("Error: "+e);
}
|