Apama 10.3.1 | 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 Exception handling.
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-2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.