I finally upgraded my Restlet application from 1.1 to 2.0, and I'm having problems with custom error pages that I just can't figure out. Since my service is XML-based, I have a template that generates XML error pages instead of the default HTML ones.
I have a StatusService registered that creates this representation in getRepresentation(). It works well for every error status except CLIENT_ERROR_UNAUTHORIZED, which results in an EmptyRepresentation on the client side. (I'm calling a back-end system where authentication/authorization is built into the call, so this status is being set in my resource post() method.) I also noticed that StatusService.getRepresentation() is only called if post() returns a null representation, which is a change from 1.1. I attempted to use this to work around the UNAUTHORIZED problem, but even if I return a representation, if the status is set to UNAUTHORIZED, the representation does not reach the client. This is a real-world application, not a simple exercise, so it's possible there's something somewhere else in the code that is causing this to happen, but I don't have any idea how. ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2908615

