Apama Documentation : Developing Apama Applications : EPL Reference : Statements : Compound statements : The try-catch statement
The try-catch statement
The try-catch statement is used to handle runtime exceptions.
The catch clause must specify a variable whose type is com.apama.exceptions.Exception.
You can nest try-catch statements in an action, and you can specify multiple actions in a try block and specify a try-catch statement in any number of actions.
See also Catching exceptions.
Example:
using com.apama.exceptions.Exception;
...
action getExchangeRate(
dictionary<string, string> prices, string fxPair) returns float {
try {
return float.parse(prices[fxPair]);
} catch(Exception e) {
return 1.0;
}
}
Copyright © 2013-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback