Deliberate decision ..

Few reasons that I know of --

a) Server code is capable of generating exceptions which can't be translated
to javascript. Things like HibernateException can't be translated to JS.
b) From a security perspective, you don't want your server side stack traces
to be available to end-users.
c) Assuming GWT could throw the exception to JS, it would have to be capable
of generating serialization/deserialization code for every exception object
in the classpath. Imagine your RPC method is like this -

public ResultDTO getSomeInformation(InputDTO obj) throws Exception;

Now, your java code could throw any sub-class of Exception and GWT doesn't
have a way to figure that out at compile time. So, it would have to convert
every Exception sub-class into appropriate JS code -- which leads to a huge
js file.

Because of this, GWT requires that you explicitly declare any exceptions you
want available in your javascript code in the throw clause of your RPC
method.

--Sri


2009/10/8 Geoffrey Wiseman <[email protected]>

>
> On Sep 12, 7:39 am, Sripathi Krishnan <[email protected]>
> wrote:
> > No - GWT doesn't propagate that exception/message to the client.
>
> Is this a bug, tracked somewhere, or a deliberate decision that
> doesn't currently make sense to me?  :)
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to