Base exception hierarchy for Python web applications
Project description
python-app-exceptions
Base exception hierarchy for Python web applications.
Installation
pip install python-app-exceptions
Usage
from python_app_exceptions import (
BaseApplicationException,
BusinessLogicError,
ValidationError,
InvalidInputError,
RetryExhaustedException,
RetryableError
)
# Raise validation errors
raise ValidationError("email", "invalid@", "Invalid email format")
# Raise business logic errors
raise BusinessLogicError("user_must_be_active", "User account is disabled")
# Raise retry errors
raise RetryExhaustedException("api_call", attempts=3)
Features
- ✅ Clean exception hierarchy
- ✅ Detailed error messages with optional details
- ✅ Framework-agnostic (works with FastAPI, Flask, Django, etc.)
- ✅ Type-safe
- ✅ Zero dependencies
Exception Hierarchy
BaseApplicationException
├── BusinessLogicError
├── ValidationError
│ └── InvalidInputError
└── RetryExhaustedException
└── RetryableError
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_app_exceptions-0.1.0.tar.gz.
File metadata
- Download URL: python_app_exceptions-0.1.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed7b5862e7545f4fb66e617259982d245df19dd9ebc7d092602ca09344642e7d
|
|
| MD5 |
897b62e4097a01afab04f798a2cebc35
|
|
| BLAKE2b-256 |
d07a74b9b88895f7305996be468f44092428a9672b6427d011bb7c608130eb6e
|
File details
Details for the file python_app_exceptions-0.1.0-py3-none-any.whl.
File metadata
- Download URL: python_app_exceptions-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5dc040ba3e1a0d02603dc774d20e61f4132eb48cef804302be91a50777f0f2b3
|
|
| MD5 |
78f90a43e9d8c6402230e4691454effb
|
|
| BLAKE2b-256 |
3862069d108be5a0bb5f3e3a9708e2f73cf65756e2775d9142a573258f9bcd99
|