Skip to main content

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

Release history Release notifications | RSS feed

1.4.0

1 file

1.3.1

1 file

1.2.1

1 file

1.2.0

1 file

1.1.2

1 file

1.1.1

1 file

1.1.0

1 file

1.0.1

1 file

This release

1.0.0 This release

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page