Re: Returning HTTP error 500 from the constructor of a Resource

2009-05-04 Thread Stephane Nicoll
Have a look to the StatusService, it provides a way to translate an exception into a status code and it also allows you to generate a custom representation. The status service is available on your application instance. HTH, S. On Thu, Apr 30, 2009 at 6:10 PM, Fabian Mandelbaum

Re: Returning HTTP error 500 from the constructor of a Resource

2009-05-04 Thread Fabian Mandelbaum
Thanks! I guess this still holds true for Restlet 1.2.x, right? On Mon, May 4, 2009 at 8:41 AM, Thierry Boileau thierry.boil...@noelios.com wrote: Hello Fabian, your approach looks fine to me. best regards, Thierry Boileau Hello there, I'm starting to learn and use Restlets (1.1.x) and I

Re: Returning HTTP error 500 from the constructor of a Resource

2009-05-04 Thread Fabian Mandelbaum
OK. Thank you both for your answers! On Mon, May 4, 2009 at 11:54 AM, Thierry Boileau thierry.boil...@noelios.com wrote: Hello Fabian, the 1.2 release introduces the ServerResource class (and deprecates the Resource class). All your initialization code should be located in the doInit method

Returning HTTP error 500 from the constructor of a Resource

2009-04-30 Thread Fabian Mandelbaum
Hello there, I'm starting to learn and use Restlets (1.1.x) and I have a question: I have a resource that I want to represent. For that representation I need some data stored in a DB (it's not a DB actually, but the concept is the same). So, following the pattern presented in the examples (1st