Hi Rahul,
On Sep 15, 2009, at 9:00 AM, Rahul Juneja wrote:
> I have a scenario in GET. Suppose i receive a request and there is
> some error and i want to return 500 but i don;t want to return any
> message with it instead just the error code. How can i do that. I
> tried that by returning null in the representation but that give all
> kind of exception trace on the server which is not what i wanted.
>
> I am using the following:
>
> @Get
> public Representation get() {
>
> //Something wrong here
> setStatus(Status.SERVER_ERROR_INTERNAL);
> return null;
>
> }
>
> Any clues or pointers on this is appreciated.
Try throwing a ResourceException instead. In 1.1 that works for
setting all kinds of status codes.
Rhett
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2395194