-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
30 lines (18 loc) · 728 Bytes
/
README
File metadata and controls
30 lines (18 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
httpexceptor |buildstatus|
.. |buildstatus| image:: https://secure.travis-ci.org/tiddlyweb/httpexceptor.png
:target: http://travis-ci.org/tiddlyweb/httpexceptor
:alt: build status
WSGI middleware to handle HTTP responses using exceptions
provides a group of exception classes representing non-2xx HTTP statuses, along
with a WSGI middleware to turn the exceptions into proper HTTP headers
originally extracted from `TiddlyWeb <http://tiddlyweb.com>`_
source repository: https://github.com/tiddlyweb/httpexceptor
Usage
-----
::
from httpexceptor import HTTPExceptor, HTTP404
# register middleware
app = HTTPExceptor(app)
# ...
if unavailable:
raise HTTP404('resource unavailable')