From 4a783ba99da9501649bebd8fb1a51d8cc8075c17 Mon Sep 17 00:00:00 2001 From: Matt Robenolt Date: Wed, 27 Mar 2013 23:03:03 -0700 Subject: [PATCH] A base class for server-side exceptions to be grouped by MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is important if you want to detect if there was an issue that resulted from the server being broken specifically, as opposed to the client issuing a bad command. See: https://github.com/disqus/nydus/pull/31 Also, let me know if there are other exceptions that could extend the base `ServerError`. These are just the two that stood out. --- redis/exceptions.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/redis/exceptions.py b/redis/exceptions.py index ffa574b309..0d10285e94 100644 --- a/redis/exceptions.py +++ b/redis/exceptions.py @@ -6,13 +6,16 @@ class RedisError(Exception): class AuthenticationError(RedisError): pass -class ConnectionError(RedisError): +class ServerError(RedisError): pass -class ResponseError(RedisError): +class ConnectionError(ServerError): + pass + +class InvalidResponse(ServerError): pass -class InvalidResponse(RedisError): +class ResponseError(RedisError): pass class DataError(RedisError):