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

> Hello,
> Patrizio Munzi a écrit :
>   
>> I'm trying to make work the following simple exception handling.
>> I just want to return the status specified.
>> The problem is that client side I cannot retrieve nothing, neither the 
>> exception or the exception message.
>>
>> I'm surely doing it wrongly, but I haven't find any written explanation on 
>> how managing exception.
>>
>> Could someone give me some hints to the right way???
>>     
> I think you can do the following in your catch block :
> throw new ResourceException(Status.SERVER_ERROR_INTERNAL, e);
> If it is not enough, try to extend StatusService class. More info in 
> this thread 
> http://restlet.markmail.org/message/ptesti33kkk5bksv?q=StatusService
> Hope it help.
> Regards,
> Laurent.
>
>   
>> Thanks
>>
>> ---------------
>> @Post
>> public void createUser(Representation entity) {
>> try {
>> // Parse the given representation and retrieve pairs of  
>> // "name=value" tokens.  
>> Form form = new Form(entity);  
>> String userId=form.getFirstValue("userId");  
>>
>> myApplication.createUser(userId);
>>
>> setStatus(Status.SUCCESS_CREATED, "Created User: " + userId);  
>> } catch(Throwable e) {
>>
>> e.printStackTrace();
>> setStatus(Status.SERVER_ERROR_INTERNAL, e, e.getMessage());  
>>
>> } 
>> }
>>     
>
>
>
>

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

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

Reply via email to