Skip to content

feat: export CacheXError, BackendNotFoundError and RequestNotFoundError - #207

Merged
allen0099 merged 1 commit into
masterfrom
feat/export-core-exceptions
Sep 26, 2026
Merged

allen0099 merged 1 commit into
masterfrom
feat/export-core-exceptions

Conversation

@allen0099

Copy link
Copy Markdown
Owner

Closes #160

Summary

@cache and the proxies raise CacheXError, BackendNotFoundError and RequestNotFoundError. Unlike every session and state exception, they could only be imported from fastapi_cachex.exceptions. They are now re-exported from fastapi_cachex, next to LockTimeoutError, and added to __all__. The docs have no list of importable names, so they are unchanged.

Tests

  • New tests/test_exports.py checks that each name is in fastapi_cachex.__all__ and is the same object as in fastapi_cachex.exceptions. Against master's __init__.py, only these three cases fail.
  • ruff, mypy --strict, full suite against live Redis and Memcached (CACHEX_REQUIRE_LIVE_SERVERS=1): 864 passed.

CHANGELOG entry

Section: Added. The entry is added in #206.

- **`CacheXError`, `BackendNotFoundError` and `RequestNotFoundError` are
  exported from `fastapi_cachex`.** They were only importable from
  `fastapi_cachex.exceptions`, unlike every session and state exception.
  ([#160](https://github.com/allen0099/FastAPI-CacheX/issues/160))

@cache and the proxies raise these exceptions, but unlike every session
and state exception they were only importable from
fastapi_cachex.exceptions. Re-export them from the package next to
LockTimeoutError.

Closes #160
@allen0099 allen0099 added this to the 0.3.8 milestone Sep 26, 2026
@allen0099 allen0099 added the enhancement New feature or request label Sep 26, 2026
@allen0099
allen0099 merged commit 25eb0ce into master Sep 26, 2026
11 checks passed
@allen0099
allen0099 deleted the feat/export-core-exceptions branch September 26, 2026 14:35
allen0099 added a commit that referenced this pull request Sep 27, 2026
Copies the CHANGELOG sections of #207, #208, #209, #211, #212, #272,
#273, #274, #275, #276, #279 and #284 into Unreleased. The #273 entry
drops expire_if_equals from its list of methods that changed, since that
primitive is new in 0.3.8.
allen0099 added a commit that referenced this pull request Sep 27, 2026
Copies the CHANGELOG sections of #207, #208, #209, #211, #212, #272,
#273, #274, #275, #276, #279 and #284 into Unreleased. The #273 entry
drops expire_if_equals from its list of methods that changed, since that
primitive is new in 0.3.8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export CacheXError, BackendNotFoundError and RequestNotFoundError from the package

1 participant