Mail sent on the 08/21 and apparently lost.
Best regards,
Thierry Boileau
--
Restlet ~ Core developer ~ http://www.restlet.org <http://www.restlet.org/>
Noelios Technologies ~ Co-founder ~
http://www.noelios.com
<
http://www.noelios.com/>
--- Begin Message ---
Hi Michael,
If you are talking about the generation of the response's
representation, I think it is simpler to throw a ResourceException with
your own error status and error description. Then, you can use the
standard status filter or a customized one. I send you a sample code
that illustrates both cases.
If you think this is too limited according to your needs, then you
surely will have to handle this directly in the Resource#represent
method and set the right entity to the response object.
best regards,
Thierry Boileau
Are there best practices for error handling? I am extending a Resource object
overriding the represent method. What is the be approach for returning an error
to the user? Should I throw a ResourceException (as defined by the interface)
or should I add the exception/error information to the Response? Or Both?
Thanks
testResourceException.jar
Description: application/java-archive
--- End Message ---