|
Hi everybody, I think there's a bug or at least something strange in ResourceException management. The getDescription method works only if I run my application in a stand-alone server. It instead doesn't work if I run in a servlet container (tomcat 5.5). I'm throwing the following exception server-side: ---------------------------------------------- } catch(Throwable e) { throw new ResourceException(Status.SERVER_ERROR_INTERNAL, e.getMessage, e); } ---------------------------------------------- And here's my client code: ---------------------------------------------- try { Form form = new Form(); form.add("userId", userId); Representation userRepresentation = form.getWebRepresentation(); Request createUserRequest = new Request(Method.POST, createUrl); createUserRequest.setEntity(userRepresentation); Response response = client.handle(createUserRequest); resultStatus = response.getStatus(); } catch (Throwable t) { System.err.println("Exception in creating User: " + userId + ". Exception: " + t); } if (resultStatus.isSuccess()) { System.out.println("Created User: " + userId + ". Status: " + resultStatus.getName() + " - Description: " + resultStatus.getDescription()); } else { System.err.println("Error in creating User: " + userId + ". Status: " + resultStatus.getName() + " - Description: " + resultStatus.getDescription()); } ---------------------------------------------- II the application runs in a servlet container I get the following message client side: Error in creating User: TestUser. Status: Internal Server Error - Description: OK instead in a stand alone server I get the right description: Error in creating User: TestUser. Status: Internal Server Error - Description: Test Exception Has anyone got any idea if it's a bug or I'm doing something wrong???? Thanks Jerome Louvel wrote: Hi all, Regarding the propagation of exceptions on the client-side, I've got some plans there:"Add exception conversion to ConverterService" http://restlet.tigris.org/issues/show_bug.cgi?id=878 Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -----Message d'origine----- De : Thierry Boileau [mailto:[email protected]] Envoyé : vendredi 7 août 2009 18:02 À : [email protected] Objet : Re: problem returning a response status Hello Patrizio and Laurent, you're right Laurent. I notice also there is a lack of documentation about this that needs to be addressed. best regards, Thierry Boileau --
Patrizio Munzi |
- problem returning a response status Patrizio Munzi
- RE: problem returning a response status Patrizio Munzi
- RE: problem returning a response status Nicolas Rinaudo
- RE: problem returning a response status Patrizio Munzi
- Re: problem returning a response status Laurent Rustuel
- Re: problem returning a response status Thierry Boileau
- RE: problem returning a response status Jerome Louvel
- Re: problem returning a response status Patrizio Munzi
- Re: problem returning a response sta... Patrizio Munzi
- Re: problem returning a response... Patrizio Munzi
- RE: problem returning a resp... Jerome Louvel
- Re: problem returning a response sta... Patrizio Munzi
- RE: problem returning a response... Jerome Louvel
- RE: problem returning a response... Jerome Louvel
- Re: problem returning a resp... Patrizio Munzi

