I am making a REST web service using restlet framework. I am using the org.restlet 2.3.1 jar
I have to customize the error response header. Depending on specific issue i have to show the response status code and status reason in response header. For this i have made a class that extends StatusService and override the toStatus method. I check the throwable and set the status accordingly. Refer sample code below.
@Override
public Status toStatus(Throwable throwable, Request request,
Response response) {
if (throwable != null) {
return new Status(500,throwable, "DD","DD");
}
return super.toStatus(throwable, request, response);
}
So whenever exception is thrown from the restlet code it is caught here and the error response is returned. The error response has correct status code that is 500 but the status reason is not correct. Instead of DD it shows Internal Server Error.
HTTP/1.1 500 Internal Server Error
Is there some but with the restlet framework version i am using. Please help.