Releases: bartTC/httpx-whackamole
Releases · bartTC/httpx-whackamole
v1.1.0 - Callback Support
Added
- Callback support: Execute custom code on errors or successful requests
ErrorContextdataclass providing exception, request, response, and suppression statuson_errorcallback invoked for all HTTP errors (both suppressed and raised)on_successcallback invoked when no error occurs- Support for callbacks via subclassing (define
on_error/on_successmethods) - Support for callbacks via
__init__parameters - Useful for integrating error tracking (Sentry), logging, and observability
- Added integration tests demonstrating realistic usage patterns with
raise_for_status() - Added version comparison links to CHANGELOG for easier navigation
- Added comprehensive callback tests (8 new test cases)
Changed
- Improved README comparison example to show realistic vanilla httpx error handling
- Updated all documentation examples to include
response.raise_for_status()calls - Refactored test suite to use
pytest.mark.parametrizefor better maintainability - Updated API documentation with callback usage patterns
Full Changelog: v1.0.0...v1.1.0
v1.0.0 - Initial Release
Added
- Initial release of httpx-whackamole
HttpxWhackamolecontext manager for policy-based error handlingErrorPolicyclass with two modes:- Explicit mode: Raise only specific status codes
- Inverted mode: Raise all except specific status codes (default behavior)
- Default policy: Safe by default (raises all errors)
ErrorPolicy.default()for the default behaviorErrorPolicy.raise_all_except()for suppressing specific status codes- Comprehensive test suite
- Full type hints for better IDE support
- Support for Python 3.9+
Design Philosophy
- Safe by default: Raises all errors to prevent accidental suppression
- Declarative: Clear, upfront error handling policies
- Simple API: Single context manager with policy object
- Production ready: Battle-tested in production environments