-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Description
Version: 3.3.11
Description: catching classes that do not inherit from BaseException is not allowed
Sample code
try:
r = redis.Redis(...)
except redis.exceptions as error:
print("Operation failed due to error: ", error)This way of catching exceptions return an exception from python complaining the aforementioned exception message. I know that one can catch it as a broad Exception and check the erorr type, but that is a very broad exception. Is there any way to catch all the exceptions under redis.exceptions? I think this can be resolved if the exceptions in redis/exceptions.py are inheriting from BaseException class.
Please let me know your thoughts on this, how to catch all the redis exceptions. I can put up a PR if my solution is deemed to be correct.
Metadata
Metadata
Assignees
Labels
No labels