For every http status code there is a handler function defined in liberator. All have sensible defaults and will return a simple english error message or an empty response, whatever is appropriate.
If an exception is thrown by a decision or action function, it will be
caught and the handler
handle-exception is called.
|Handler key||status code||redirect?|
|handle-unprocessable-entity since 0.9.0||422|
|handle-exception since 0.12.0||500|
The handlers that are marked as redirecting will set a “Location” header that is generated from the following mechanism:
Liberator uses the lookup key
:location in the context. You
can set this key from a decision function that decides on the
:post-redirect?. The value can either be a
constant value or a function that will be called with the current
You could also use a constant value for :post-redirect like the execution model for liberator describes.
If no location was found in the context, then Liberator will lookup
:location in the resource definition. Note that this
value is used for all redirecting handlers if :location was not set