Throwable unwrapped = unwrap(ex);
if (unwrapped instanceof ProcessingException) {
throw (ProcessingException)unwrapped;
}
throw new CascadingRuntimeException(ee.getMessage(), unwrapped);
} catch (EcmaError ee) {
String msg = ToolErrorReporter.getMessage("msg.uncaughtJSException", ee.toString());
if (ee.getSourceName() != null) {
Context.reportRuntimeError(msg,
ee.getSourceName(),
ee.getLineNumber(),
ee.getLineSource(),
ee.getColumnNumber());
} else {
Context.reportRuntimeError(msg);
}
throw new CascadingRuntimeException(ee.getMessage(), ee);
} finally {
updateSession(environment, thrScope);
cocoon.invalidate();
Context.exit();
}