I am sorry. I have been staring at my debugger which showed the internal values of the InvocationTarget exception. Therfore the field "cause" was indicated with null. But the getCause method points to the target field instead. So everything is fine.
Thank you for your feedback Scott. Best Regards / Viele Grüße Sebastian On Oct 22, 11:50 pm, Scott Blum <[email protected]> wrote: > My JDK says: > > *Throwable java.lang.reflect.InvocationTargetException.getTargetException()* > > Get the thrown target exception. > > This method predates the general-purpose exception chaining facility. The > Throwable.getCause() method is now the preferred means of obtaining this > information. > > Returns: > the thrown target exception (cause of this exception). > > On Fri, Oct 22, 2010 at 3:48 PM, Sebastian <[email protected]> wrote: > > Hi, > > > the RPC.java has a method public static String > > invokeAndEncodeResponse which does catch an InvocationTargetException > > and tries to encode the error. > > > Here a snippet: > > > catch (InvocationTargetException e) { > > // Try to encode the caught exception > > // > > Throwable cause = e.getCause(); > > responsePayload = encodeResponseForFailure(serviceMethod, cause, > > serializationPolicy, flags); > > } > > return responsePayload; > > > The disadvantage is that the information about the exception is > > actually in e.getTarget. As a consequence no detailed are carried to > > the server. It indicates the normal "error on server" message. > > e.getCause is null. > > > Is there any motivation behind using the e.getCause or is this > > actually a bug. > > > Best Regards > > > Sebastian Hennebrueder > > > -- > >http://groups.google.com/group/Google-Web-Toolkit-Contributors > > -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
