Hi

I commented on issue #411 (GWT edition masks response code and headers for 302 
responses).

I wonder if this is confirmed. I cannot figure out how to handle status "404 
Not found" or "3xx Redirection". 


For instance, I am using Google Federated login and the user gets redirect to 
the login page. All fine when you are serving HTML but when the GWT proxy 
expects a GWT serialized object, it chokes and throws an exception. The 
onFailure callback is called and all I am left with is an error message. While 
if I would know this is 302, I can reload the interface and ask to login again 
because the session expired.

Similar story for e.g. 404 when calling an API. That's not a failure, the data 
was deleted and I want to handle this like an OptimisticLockException.

For BusinessRuleExceptions (which could be e.g. validations that I cannot 
verify on the client but that are detected on the server), my API sends a 400 - 
Bad Request. This is done in a custom StatusService. Even better, I would like 
to send a serialized BusinessRuleException back to the client along with error 
status code. But anything but 20x Sucess respones seem to end in onFailure. 

If I jump into the code generated by deferred binding of the GWT module, I see 
this :

      if (getClientResource().getStatus().isError()) {
          callback.onFailure(new 
ResourceException(getClientResource().getStatus()));
        } else {
           ....
      }

So IMO, any useful information about status code or response entity in case of 
a error status code is not passed on to the client.


Thx

Koen

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3028137

Reply via email to