I have over ridden the getStatus method of the custom status service and set
the status and returned it. I have tried various things but the status on
the client side always show as Server Internal Error and no error message /
description is available. I've confirmed that the getStatus method is
invoked when StorageException is thrown on server side.
The server runs under Apache Tomcat. I am using Annotations. Client is a a
swing client using Restlet. Do I need to add some xml configuration some
where ? On client side, I am retrieving the status from ClientResource. What
am I missing here ? Please help.
ErrorStatusService extends StatusService {
// StorageSystemException is an exception thrown by our application
public Status getStatus(Throwable throwable, Request req,
Response resp){
logger.debug("ErrorStatusService.getStatus new");
Status status = null;
if (throwable instanceof ResourceException) {
return super.getStatus(throwable, req, resp);
}
else if (throwable instanceof StorageSystemException){
logger.error("ErrorStatusService.getStatus -
StorageSystemException
caught");
status = new Status(Status.SERVER_ERROR_INSUFFICIENT_STORAGE,
"StorageSystemException");
resp.setStatus(new
Status(Status.SERVER_ERROR_INSUFFICIENT_STORAGE,
"StorageSystemException"));
}
return status;
}
--
View this message in context:
http://restlet-discuss.1400322.n2.nabble.com/Sending-server-side-exceptions-error-codes-back-to-client-tp7219795p7220293.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2910747