Release 0.2.1 – Async Support for extra_log_fields & Python 3.9 Compatibility
APIException v0.2.1
✨ What's New
- Async support for
extra_log_fields- You can now define your callback as
async defand useawait request.body()directly. - Fully backward compatible with sync functions.
- You can now define your callback as
- Python 3.9 compatibility restored
- Introduced conditional import of
TypeGuardviatyping_extensions. - Officially supports Python 3.9 → 3.13.
- Introduced conditional import of
- Improved type-safety and cross-version stability in
response_utils.py. - Updated pyproject.toml for extended compatibility.
🧠 Highlights
- Cleaner and safer async logging system.
- Backward-compatible design.
- Ready for production FastAPI environments.
- Verified build on PyPI: apiexception 0.2.1
🧩 Upgrade
pip install -U apiexception📄 Related Docs
| 📘 Section | 🔗 Link |
|---|---|
| 🧭 Usage Guide: How to register global exception handlers | register_exception_handlers |
⚙️ Response Models: Understanding ResponseModel and RFC7807ResponseModel |
Response Models Guide |
🧩 Custom Exceptions: Defining your own BaseExceptionCode |
Custom Exception Codes |
🪵 Logging: Structured logging setup & extra_log_fields usage |
Logging & Monitoring |
🧱 APIResponse Helpers: APIResponse.default() and APIResponse.custom() examples |
APIResponse Reference |
| 🧠 Changelog: All notable updates, fixes, and improvements | Full Changelog |