Le 6 août 09 à 23:29, Nicolas Rinaudo a écrit :

> Yes, you're absolutely right, that's in the JAX RS specifications. I  
> was just wondering whether RESTlet had an extension to the basic  
> specifications that allowed more control over what error code was  
> used (an @Error(400) annotation, for example).
>
> The different for the user, if we're talking about a web user, is  
> slim at best. An error occurred but that's not really his problem,  
> the UI should have sheltered him from such basic syntax errors.
>
> For the developer writing a client application, however, it can save  
> a lot of time. Knowing precisely why your implementation fails is  
> always preferable in my opinion than just having a generic "failed"  
> error.

Very true. Indeed, HTTP specifies that the server should include, in  
the response, an entity explaining the error situation. You could  
provide details here. Should be doable with JAX RS using the exception  
mapping provider mechanism, I think.

Philippe Mougin

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

Reply via email to