On Sun, Jan 30, 2011 at 4:16 AM, Andrea Aime
<andrea.a...@geo-solutions.it>wrote:

> Hi,
> I was writing some tests for the simple feature service implementation
> when I got tangled up in a separate issue... the basic test I wrote
> was failing to build a valid response, but the response status I got back
> was a 200 and just a "[" as the content of the response.
> No logs, no way to know what happened.
>
> After some debugging I found that Restlet logged the exception that
> was thrown only at the INFO level, which is disabled during tests,
> and that it did set the status to 500, but too late because the response
> was already committed.
>
> For the first issue I'm attaching a patch that seems to solve it:
> the ServletConverter gets subclassed to override the logging level
> of the error to SEVERE


The only issue I see with raising the logging level might be that exceptions
written out when it is not wanted. The rest stuff makes use of exceptions to
report back specific error codes. However in most cases it is an error
case... like a 404 when asking for a resource. But one could send back any
error code via an exception in non error cases.

That said we don't really have a way to differentiate so just raising the
level is fine. Better to give more information than less :)

> .
>
> For the second one (setting the status before commiting the request)
> I guess we should have a output strategy
> handling on the rest path, so that we cache some kb of data before
> sending back a response.
> I _think_ this may be doable by wrapping the httpservletresponse
> into one that would build a stream backed by the output strategy
>
> Seems like a good idea, +1


> Opinions?
>
> Cheers
> Andrea
>
>
> --
> Ing. Andrea Aime
> Technical Lead
>
> GeoSolutions S.A.S.
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
>
> phone: +39 0584962313
> fax:     +39 0584962313
>
> http://www.geo-solutions.it
> http://geo-solutions.blogspot.com/
> http://www.linkedin.com/in/andreaaime
> http://twitter.com/geowolf
>
> -----------------------------------------------------
>
>
> ------------------------------------------------------------------------------
> Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
> Finally, a world-class log management solution at an even better
> price-free!
> Download using promo code Free_Logger_4_Dev2Dev. Offer expires
> February 28th, so secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsight-sfd2d
> _______________________________________________
> Geoserver-devel mailing list
> Geoserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>
>


-- 
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to