Hi All,

We are developing an application using Restlet. We are struggling with an
issue in our application. We are calling  a rest service from client and we
are unable to catch the exception which is thrown from server resource in
Restlet.

Following is the code we have written inside the resource:
There are two ways we tried which as follows,
1)* throw new ResourceException(new InvalidParameterException("Invalid
accountId"));*
2) *setStatus(Status.CLIENT_ERROR_EXPECTATION_FAILED,** new
InvalidParameterException("Invalid accountId"), **
"InvalidParameterException");*

Following is the code we have written inside the client for catching the
exception:
*resource.getResponse().getStatus() *:* *It gives me Internal Server Error
(500)
*resource.getResponseEntity().getText() *: It gives me status page with html
code.
*resource.getResponse().getStatus().getThrowable().getMessage()* : null

Could you suggest me how to catch the exception inside the client. Please
send the response as soon as possible. So that i can proceed.


Thanks and Regards,
Praveen Nukasani,
Ph no:+91 98850 13061,
Appmint Info Technologies Pvt Ltd, Hyderabad.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2697501

Reply via email to