http-exceptions
Raisable HTTP Exceptions
Decision gist · record as of 2026-08-14
Yes, if you are building HTTP APIs and want to decouple business logic from HTTP response construction. The package is stable, has no known vulnerabilities, and low install friction. The main caveat is that the latest release is from 2022-02-15, so verify that it integrates well with your specific framework version before committing to it.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with a single lightweight runtime dependency (importlib-metadata).
- The package is actively maintained with a recent commit on 2026-08-10, though the latest release dates to 2022-02-15.
License · maintenance · safety
MIT (permissive) — Licensed under MIT (permissive), so you can use it freely in commercial and open-source projects without copyleft obligations.
last release 2022-02-15 (1641 days) · last repo commit 2026-08-10 · 3 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 283,513 downloads/mo, #8,073 on PyPI
Alternatives
Verify before relying
pip install http-exceptions
from http_exceptions import ForbiddenException, HTTPException
# Raise a specific exception
raise ForbiddenException()
# Or dynamically from a status code
raise HTTPException.from_status_code(status_code=403)(message="Access denied")- Whether the package's exception classes integrate seamlessly with popular frameworks like FastAPI, Django, or Starlette
- Whether custom message or metadata can be attached to exceptions beyond the status code
What it is and what it does
http-exceptions is a lightweight exception library that maps HTTP status codes to Python exception classes. Instead of manually catching errors and constructing HTTP responses, you raise semantic exceptions like ForbiddenException or BadRequestException directly from your business logic, and let your web framework handle the conversion to an HTTP response.
The package provides exception classes for all standard HTTP client errors (400–499) and server errors (500–599), organized into ClientException and ServerException base classes for hierarchical catching. It also supports dynamic exception lookup via HTTPException.from_status_code(), letting you raise the appropriate exception based on a status code at runtime. The single runtime dependency is importlib-metadata, and it supports Python 3.7 through 3.10.
Use it for
- Raise ForbiddenException or UnauthorizedException from service functions without coupling to HTTP response objects
- Catch ClientException to handle all 4xx errors uniformly, or ServerException for all 5xx errors
- Convert an incoming HTTP response status code to the corresponding exception and re-raise it in your application
- Simplify FastAPI or other REST framework error handling by raising exceptions instead of returning error responses
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are building HTTP APIs and want to decouple business logic from HTTP response construction.
The package is stable, has no known vulnerabilities, and low install friction. The main caveat is that the latest release is from 2022-02-15, so verify that it integrates well with your specific framework version before committing to it.
Install
http-exceptions on PyPI
Before you install
Low install friction with a single lightweight runtime dependency (importlib-metadata). The package is actively maintained with a recent commit on 2026-08-10, though the latest release dates to 2022-02-15.
License in practice
Licensed under MIT (permissive), so you can use it freely in commercial and open-source projects without copyleft obligations.
Quickstart
pip install http-exceptions
from http_exceptions import ForbiddenException, HTTPException
# Raise a specific exception
raise ForbiddenException()
# Or dynamically from a status code
raise HTTPException.from_status_code(status_code=403)(message="Access denied")
Verify before relying
- Whether the package's exception classes integrate seamlessly with popular frameworks like FastAPI, Django, or Starlette
- Whether custom message or metadata can be attached to exceptions beyond the status code
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.7,<4.0 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageimportlib-metadata |
| Maintenance | Actively maintained 1,641 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 283,513 / month, #8,073 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Build ToolsTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: http_exceptions-0.2.10-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “http status code exceptions”
- http-exceptionsProvides a set of raisable exception classes corresponding to HTTP…
- zExceptionszExceptions provides a collection of exception classes and utilities…
- aioresponsesMocks HTTP requests made by aiohttp's ClientSession for testing…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also zExceptions · retryhttp · python-status · httsleep · httmock · fastapi-health · requestsexceptions · fastapi-decorators · exceptiongroup · tuspyserver