Try to cast Throwable into Exception
Status: Inactive
Brought to you by:
bmarchesson
at net.sf.gilead.gwt.PersistentRemoteService.processCall(PersistentRemoteService.java:205) :
Exception exception = (Exception) GileadRPCHelper.parseReturnValue(e.getCause(), _beanManager);
you are trying to cast e.getCause() into Exception but if e is an Exception, e.getCause() can be an Error (and perhaps a Throwable).
I have chage the line below by :
Exception exception = (Exception) GileadRPCHelper.parseReturnValue(e, _beanManager);
and now I have the Expected Error, perhaps the correct correction should be to cast into a Throwable object, not sure.
Regards.
Hello,
You are right, it can lead to an issue.
It will be fixed for the next release.
Regards
Bruno
Hi,
The fix applied in trunk changed the original behavior. After the fix, the wrapping InvocationTargetException is returned to the client. If one exists, the underlying target exception should be returned for backwards compatibility.
A fix for this could look like this:
Throwable exception = e;
if (e.getTargetException() != null) {
exception = e.getTargetException();
}
// Clone exception if needed
exception = (Throwable) GileadRPCHelper.parseReturnValue(exception, _beanManager);
Regards,
Samuel