users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Exceptions for representing HTTP errors

From: Julian Reschke <julian.reschke_at_gmx.de>
Date: Tue, 15 May 2012 20:13:43 +0200

On 2012-05-15 19:56, Bill Burke wrote:
> ...
>
> I agree mostly with Marek. iMO, I don't see the problem with having both
> fine-grain exceptions for each and *every* code and family super

Just keep in mind that new status codes can and will be defined.

> classes. Really what is the harm? Especially if you put them in a
> separate package? The exception classes would be really really simple...
> Additionally, maybe 3xx have a helper method that returns the redirect
> URL. 503 has a helper method returning the Retry-After header, etc...

s/URL/URI/ :-)

In fact, the exceptions need to provide access to all information in the
HTTP response, and that includes the status code, the response header
fields *and* the payload.

> ...

Best regards, Julian