zExceptions is a Python library containing common exceptions used primarily within the Zope and Plone web frameworks. It provides specialized exceptions like `NotFound`, `Redirect`, `Unauthorized`, and `Forbidden` that map to HTTP status codes, simplifying error handling in Zope applications. The current version is 6.0, and it follows an infrequent release cadence, often aligning with Zope framework updates.
pip install zexceptionsVerified import paths — ran on the pinned version, not inferred.
Demonstrates raising and catching common `zexceptions` like `NotFound`, `Unauthorized`, and `Redirect`, typical in a web request handling scenario. `Redirect` takes a `location` and an optional `code` for the HTTP redirect status.
Upgrade your Python environment to 3.10 or newer. If you must use an older Python version, pin `zexceptions` to `<6.0`.
If upgrading from `zexceptions < 5.0` to `5.0` or later, code relying on `HTTPExceptionHandler` will break. Remove or refactor code that uses `HTTPExceptionHandler`. Modern Zope/Plone versions handle exceptions directly or through WSGI middleware, making this class obsolete.
While you can import and raise zexceptions in any Python application, their specific handling (e.g., mapping to HTTP responses) is usually managed by the Zope or Plone framework. Without such a framework, you'll need to implement custom exception handling to convert them into appropriate HTTP responses (e.g., in Flask/Django middleware).
No dependency data recorded yet.