Skip to main content

UNKNOWN

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](http://tiddlyweb.com)

Usage

from httpexceptor import HTTPExceptor, HTTP404

# register middleware app = HTTPExceptor(app)

# …

if unavailable:

raise HTTP404(‘resource unavailable’)

Project details


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