Le 7 août 09 à 00:19, Nicolas Rinaudo a écrit :

>
> I haven't tested it myself, but I'm not sure that ExceptionMappers  
> actually kick-in for exceptions triggered by the underlying Engine.

I think it does, but a test would be needed to confirm.

> Regardless of that consideration though, the WebApplicationException  
> thrown in such cases is just a generic one with a 404 status code.  
> Even if I could write an ExceptionMapper to catch it, there'd be no  
> way for me to differentiate it from other 404s. Well, let me  
> rephrase that. I don't see how I'd go about differentiating it, but  
> I'd love to hear your thoughts on the subject :)

Yes, if the exception you get is just a generic one, it'll be hard! I  
was (optimistically) conjecturing some additional information might be  
provided (e.g. in the exception message, or in the exception cause).  
If not, then one approach is to implement the method that handles the  
request (e.g., annotated with @Path). From there, you could determine  
yourself if there is a client error in the params and throw an  
exception stuffed with an entity describing the problem.

Best,
Philippe Mougin

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

Reply via email to