return ret != null ? returnType.cast(ret) : null;
}
return null;
} catch (RaiseException e) {
runtime.printError(e.getException());
throw new InvokeFailedException(e.getMessage(), e);
} catch (Throwable e) {
Writer w = container.getErrorWriter();
if (w instanceof PrintWriter) {
e.printStackTrace((PrintWriter)w);
} else {
try {
w.write(e.getMessage());
} catch (IOException ex) {
throw new InvokeFailedException(ex);
}
}
throw new InvokeFailedException(e);
} finally {
if (sharing_variables) {
runtime.getCurrentContext().popScope();
}
}