Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A wrong exception is raised when prefix from the setup does not match a prefix in a passed key #155

Closed
simon-liebehenschel opened this issue Aug 22, 2023 · 2 comments

Comments

@simon-liebehenschel
Copy link

Code example

import asyncio
from cashews import cache


async def func():
    cache.setup("mem://", prefix="foobar")
    await cache.set(key="spameggs:key", value=42)


asyncio.run(func())

Current behavior

A misleading confusing error:

cashews.exceptions.NotConfiguredError: run `cache.setup(...)` before using cache

Expected behavior

Raise an exception with a correct message.

@Krukov
Copy link
Owner

Krukov commented Sep 17, 2023

Fixed - now it will raise

cashews.exceptions.NotConfiguredError: Backend for given key not configured

@Krukov Krukov closed this as completed Sep 17, 2023
@Krukov
Copy link
Owner

Krukov commented Sep 17, 2023

Thanks for contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants