diff options
author | andy <andy@andymccurdy.com> | 2011-11-07 16:58:38 -0800 |
---|---|---|
committer | andy <andy@andymccurdy.com> | 2011-11-07 16:58:38 -0800 |
commit | 60e3be561417b3252d832c9fb45bf6072e3ccce8 (patch) | |
tree | 8f486346905510fc7d25b8830c8b6a80ff512853 /redis/connection.py | |
parent | 520cc89a67407bfcdf11beed25ceb8cbd0d2589e (diff) | |
download | redis-py-60e3be561417b3252d832c9fb45bf6072e3ccce8.tar.gz |
Raise an authentication error if an invalid password is supplied
Diffstat (limited to 'redis/connection.py')
-rw-r--r-- | redis/connection.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/redis/connection.py b/redis/connection.py index 5a0b511..1a5466f 100644 --- a/redis/connection.py +++ b/redis/connection.py @@ -4,7 +4,8 @@ from redis.exceptions import ( RedisError, ConnectionError, ResponseError, - InvalidResponse + InvalidResponse, + AuthenticationError ) try: @@ -215,7 +216,7 @@ class Connection(object): if self.password: self.send_command('AUTH', self.password) if self.read_response() != 'OK': - raise ConnectionError('Invalid Password') + raise AuthenticationError('Invalid Password') # if a database is specified, switch to it if self.db: |