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

Add response error constant to Redis managers so that exceptions can be caught sanely. #1026

Conversation

hodgestar
Copy link
Contributor

Currently one has to do:

try:
    redis.op(...)
except Exception:
    ...

for most redis operations because the class of exception raised depends on the kind of redis one has (sync, async, or fake).

Adding a RESPONSE_ERROR attribute to the redis manager would allow us to do:

try:
    redis.op(...)
except redis.RESPONSE_ERROR:
    ...

Much nicer.

@hodgestar
Copy link
Contributor Author

@KaitCrawford Ready for review.

@KaitCrawford
Copy link
Contributor

👍 looks good to me

@hodgestar hodgestar merged commit 664052c into develop Mar 3, 2016
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

Successfully merging this pull request may close these issues.

2 participants