users@jax-rs-spec.java.net

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

From: Jan Algermissen <jan.algermissen_at_nordsc.com>
Date: Thu, 17 May 2012 10:16:04 +0200

On May 15, 2012, at 8:13 PM, Julian Reschke wrote:

>
> 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.

Essentially, I IMHO helps with their design to remember well that HTTP error responses are *part of* the current application[1]. As such, they are an important contribution to the client's application state (even if that state apparently is an error state).

That is why access to the response entity is important because it usually (in a well designed RESTful system anyway) contains the hypermedia controls for the client to transition to subsequent states to resolve the error.

For human targeted Web sites a 404 page, for example, will still display the site's top navigation etc. as opposed to just display 'Not found' on an otherwise blank screen.

Jan


[1] Application in the REST-sense, not in the e.g. 'Web app' sense.


>
>> ...
>
> Best regards, Julian