Hi Matt, This is not currently possible. Also, the interest would be minimal: as soon as the representation is written, it is not possible to change the status anyway.
I would suggest an alternate design where you would leverage the new RepresentationInfo class added to Restlet 2.0 by overriding the "ServerResource#getInfo(Variant)" method. This would allow you to support content negotiation and conditional processing without having to connect to your database. Then, when the "get(Variant)" method calls you back, you would connect to your database, throw any exception that occurs and return a verified representation. Let me know if you need more guidance. 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 : Matt Kennedy [mailto:[email protected]] Envoyé : vendredi 12 juin 2009 19:53 À : [email protected] Objet : Setting Status from the write method of a Representation In order to support streaming writes of large ResultSets from a database, I am deferring execution of my query until the write() method of my Representations. The resource is responsible for configuring the query string and handling connection issues with the DB, but if there is a problem with the URL which results in some bad sql, and an exception is thrown inside the write method, the server always returns a 500 response even though I have subclassed StatusService and it works for exceptions thrown in the Resource. Is this expected behavior? Are there suggestions on how I can set an error status if an exception occurs in a representation? ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=23616 98 ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2362543

