* Base class for error functions.
*/
public abstract class AbstractErrorFunction extends AbstractFunction {
protected SAXParseException getException (ExpressionContext context) throws ExpressionException {
TryModel model = (TryModel) ((SimpleExpressionContext) context).findObject(TryModel.class);
if (model == null) {
throw new ExpressionException("Error functions must be used inside try block.");
}
List exceptions = model.getExceptions();
SAXParseException x = exceptions.isEmpty() ? null : (SAXParseException) exceptions.get(0);
return x;
}