httpexceptor
lightweight WSGI middleware to handle common 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
Usage
from httpexceptor import HTTPExceptor, HTTP404
# register middleware
app = HTTPExceptor(app)
# ...
if unavailable:
raise HTTP404('resource unavailable')
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
httpexceptor-1.1.0.tar.gz
(3.0 kB
view details)
File details
Details for the file httpexceptor-1.1.0.tar.gz.
File metadata
- Download URL: httpexceptor-1.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76a7ce8074fcc0593dc97f5fcc3a1b1ca3b18a7e4488d27d49a28fb6b902a83e
|
|
| MD5 |
513404a360eaf7d5e07dc08981649a6c
|
|
| BLAKE2b-256 |
554f5f97e5ad249482878ffe712a2e01d48177d605d5d6dbc127bf5b06c16f1e
|