Skip to main content

lightweight WSGI middleware to handle common HTTP responses using exceptions

Project description

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')

Project details


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.0.1.tar.gz (2.1 kB view details)

Uploaded Source

File details

Details for the file httpexceptor-1.0.1.tar.gz.

File metadata

File hashes

Hashes for httpexceptor-1.0.1.tar.gz
Algorithm Hash digest
SHA256 84a52423906091aa44256e66149271ce4f50abd8bf1f2807d22fe31e6a905d1f
MD5 328d8b5f386f80122e433210afddf0af
BLAKE2b-256 31e6d15c296307c7f58900354c3fe41c1c352aa5988d97ecfd9009d0f4840249

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page