I have something similar to the below code:
@PUT
@Path("/bean/{id}")
@Consumes(APPLICATION_JSON)
@Override
public void set(@PathParam("id") final int beanId, final MyBean bean)
{
...
if (...)
{
...
try
{
...
}
catch (final Exception e)
{
tx.rollback();
setResponse(new Response(getRequest()));
getResponse().setStatus(SERVER_ERROR_INTERNAL, e, e.getMessage());
}
}
else
{
getLogger().info("Status: " + CLIENT_ERROR_NOT_FOUND);
setStatus(CLIENT_ERROR_NOT_FOUND);
}
...
}
As you can see I tried two approaches to setting the status code.
Neither works. I get a 204 not a 500 (try-catch) or a 404 (if-else).
What am I doing wrong?
I'm using Restlet 2.0.0.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2657606