Apama 10.3.1 | Apama Documentation | Developing Apama Applications | EPL Reference | Statements | Simple statements | The throw statement
 
The throw statement
The throw statement causes an exception to be thrown. If it is not caught by a try ... catch in that action or any calling actions, then the monitor instance is terminated along with any listeners it has. The syntax is:
throw expression;
where expression must be of the Exception type.
Example:
action getAverageReading() returns float {
if readingsCount <= 0 {
throw Exception("No readings", "IllegalArgumentException");
}
return readingsSum / readingsCount.toFloat();
}
See also Exception handling.

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.