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,
Lalitha Gayathri K.

-- 
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/Not-getting-Exception-from-Service-Resource-to-Client-tp5913844p5913844.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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

Reply via email to