Hello Itzik, Your interface needs to speficy an Exception that extends IsSerializable, and only those exceptions should be cast from the service. Thus, if the exception you are throwing for unauthorized access extends that base exception you should get it also in the client side.
On a further notice: it might be better if you don't aim at propagating internal failures to the client, i.e. when a database connection times out the client doesn't need to know that your oracle on 192.168.2.10 doesn't respond on port 3000 anymore for user root... a generic one-for-all technical error (we are experiencing some technical difficulties) will do just fine. On Oct 7, 10:31 am, Itzik Yatom <[email protected]> wrote: > Hi, > > Our project uses GWT and App engine. We have a problem with catching > exceptions. > When we define an exception as part of method signature in our RPC > asynch interface and implement it at the server, the client side > catches it and everything works fine. > > But in other 'unusual' case we have problems with catching the > exception: > We do some general checks in all our RPC server methods, for example > checking authorization of current user, and if user is not authorized > we throw a specific exception. > For that purpose we have extended the class RemoteServiceServlet and > overridden the method onAfterRequestDeserialized, in this method if > user is not authorized we throw our UnAuthorizedException exception. > > The problem is that the client side gets just a general > StatusCodeException with code 500 (internal server error). I have > found this relevant code at RpcCallbackAdapter.onResponseReceived: > . > . > if (statusCode != Response.SC_OK) { > caught = new StatusCodeException(statusCode, encodedResponse); > . > . > The question is how we can get the actual exception in this case? is > there a way for the client to get the returned Response object ? Any > other direction ? > > Thanks > Itzik Yatom -- 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.
