I just modified this example to turn it into a JUnit test.

On Tue, Jan 24, 2012 at 11:05 PM, Tim Peierls <[email protected]> wrote:

> I get the correct status code on the client side. Run this code:
>
> http://pastebin.com/3nzsjFi1
>
> The description I set on the server side is not passed to the client side.
>
> --tim
>
>
> On Tue, Jan 24, 2012 at 2:00 PM, D G <[email protected]> wrote:
>
>> Thanks Tim for your response. Earlier I was using 2.0.9 and after your
>> response, I tried with 2.1-RC2. However, I see the same result :((. Code
>> in
>> the status is 507 and description = Insufficient Storage
>> In apache logs, I see
>> *************************************************
>> Jan 25, 2012 12:16:56 AM org.restlet.resource.ServerResource doCatch
>> WARNING: Exception or error caught in server resource
>> Insufficient Storage (507) - Storage system exception
>> Here are the code snippets.
>> *************************************************
>>
>> Server side
>> ********
>> // I've tried with StorageSystemException extends Exception and
>> RuntimeException
>> // StatusService is not overrriden
>> catch (StorageSystemException se) {
>>                        throw new
>> ResourceException(Status.SERVER_ERROR_INSUFFICIENT_STORAGE,
>> "Storage system exception", new RuntimeException());
>>
>> Client Side
>> ********
>> ClientResource cr = new ClientResource(url);
>> MyResource myres = cr.wrap(MyResource.class);
>> int val = myres.callMethod();
>> }
>> catch(Exception e) {
>> Status s = cr.getStatus();
>> s.getDescription();
>> }
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://restlet-discuss.1400322.n2.nabble.com/Sending-server-side-exceptions-error-codes-back-to-client-tp7219795p7221382.html
>> Sent from the Restlet Discuss mailing list archive at Nabble.com.
>>
>> ------------------------------------------------------
>>
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2910819
>>
>
>

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

Reply via email to