Did you know ... | Search Documentation: |
http_exception.pl -- Map Prolog exceptions to HTTP errors |
This module maps exceptions from various parts of the HTTP libraries as well as exceptions from user handler predicates into meaningful HTTP error codes such as 4XX and 5XX codes. For example, existence errors on http locations are mapped to 404 while out-of-stack is mapped to 503.
This library provides two hooks:
http(not_modified)
provides backward compatibility to http_reply(not_modified)
.http:client_backtrace
is true
.error(Formal, context(Stack,
Context))
is caught and subsumes_term(ContextTemplate, Context)
is true, translate the exception into an HTTP 400 exception. If
the exception contains a stack-trace, this is stripped from the
response.
The idea behind this hook is that applications can raise 400 responses by