users@jersey.java.net

Question about error handling in REST

From: Harald Kirsch <pifpafpuf_at_gmx.de>
Date: Sun, 20 Jul 2008 11:57:19 +0200

Hello,

can anyone shed some light on best practices for handling errors when
creating a resource.

My application provides for the upload of some data which results in the
creation of a new resource. If the uploaded data is malformed, I want to
display the main application page, but with an additional error message.
How is this normally implemented?

Ideally I would like to just call the resource method to create the main
resource while providing some error information to render. But how would
I instruct the browser that what it is getting is no longer the upload
resource, but the main page. I tried setting the location header, but at
least firefox 2 ignores this and keeps showing the upload-URL it
originally requested.

If, instead, I send a redirect to the browser, how should I preserve the
 error information to be picked up by the redirected resource?

Thanks,
Harald.

-- 
--------------+---------------------------------------------
Harald Kirsch | pifpafpuf bei gmx punkt de