Skip to main content

WSGI middleware to handle HTTP responses using exceptions

Project description

httpexceptor

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

source repository: https://github.com/tiddlyweb/httpexceptor

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

Uploaded Source

File details

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

File metadata

File hashes

Hashes for httpexceptor-1.3.1.tar.gz
Algorithm Hash digest
SHA256 abe9216349f9996e4066e07a8219e73190a9bad0977efe4cb83640626f85149d
MD5 5895aab4bd64a251ab22eea01fd0d043
BLAKE2b-256 30f54b2284280fc1238058b3e4644edb31e2a43b543d8ed59242d77f44104a51

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