Hi everybody,
I'm trying to make work the following simple exception handling.
I just want to return the status specified.
The problem is that client side I cannot retrieve nothing, neither the
exception or the exception message.
I'm surely doing it wrongly, but I haven't find any written explanation on how
managing exception.
Could someone give me some hints to the right way???
Thanks
---------------
@Post
public void createUser(Representation entity) {
try {
// Parse the given representation and retrieve pairs of
// "name=value" tokens.
Form form = new Form(entity);
String userId=form.getFirstValue("userId");
myApplication.createUser(userId);
setStatus(Status.SUCCESS_CREATED, "Created User: " + userId);
} catch(Throwable e) {
e.printStackTrace();
setStatus(Status.SERVER_ERROR_INTERNAL, e, e.getMessage());
}
}
----------------
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2381230