Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Commit 40708ff

Browse files
committed
Make warnings more verbose
1 parent 29a0874 commit 40708ff

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

depends/docker-registry-core/docker_registry/core/lru.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ def wrapper(*args):
6767
key = cache_key(key)
6868
try:
6969
redis_conn.set(key, content)
70-
except redis.exceptions.ConnectionError:
71-
logging.warning("LRU: Redis connection error")
70+
except redis.exceptions.ConnectionError as e:
71+
logging.warning("LRU: Redis connection error: {0}".format(e))
7272

7373
return f(*args)
7474
if redis_conn is None:
@@ -83,8 +83,8 @@ def wrapper(*args):
8383
key = cache_key(key)
8484
try:
8585
content = redis_conn.get(key)
86-
except redis.exceptions.ConnectionError:
87-
logging.warning("LRU: Redis connection error")
86+
except redis.exceptions.ConnectionError as e:
87+
logging.warning("LRU: Redis connection error: {0}".format(e))
8888
content = None
8989

9090
if content is not None:
@@ -94,8 +94,8 @@ def wrapper(*args):
9494
if content is not None:
9595
try:
9696
redis_conn.set(key, content)
97-
except redis.exceptions.ConnectionError:
98-
logging.warning("LRU: Redis connection error")
97+
except redis.exceptions.ConnectionError as e:
98+
logging.warning("LRU: Redis connection error: {0}".format(e))
9999
return content
100100
if redis_conn is None:
101101
return f
@@ -109,8 +109,8 @@ def wrapper(*args):
109109
key = cache_key(key)
110110
try:
111111
redis_conn.delete(key)
112-
except redis.exceptions.ConnectionError:
113-
logging.warning("LRU: Redis connection error")
112+
except redis.exceptions.ConnectionError as e:
113+
logging.warning("LRU: Redis connection error: {0}".format(e))
114114
return f(*args)
115115
if redis_conn is None:
116116
return f

docker_registry/lib/layers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def enqueue_diff(image_id):
3939
try:
4040
if cache.redis_conn:
4141
diff_queue.push(image_id)
42-
except cache.redis.exceptions.ConnectionError:
43-
logger.warning('Diff queue: Redis connection error')
42+
except redis.exceptions.ConnectionError as e:
43+
logger.warning("Diff queue: Redis connection error: {0}".format(e))
4444

4545

4646
def generate_ancestry(image_id, parent_id=None):

docker_registry/lib/mirroring.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,11 @@ def wrapper(namespace, repository, *args, **kwargs):
109109
data = cache.redis_conn.get('{0}:{1}'.format(
110110
cache.cache_prefix, tag_path
111111
))
112-
except cache.redis.exceptions.ConnectionError:
112+
except cache.redis.exceptions.ConnectionError as e:
113113
data = None
114-
logger.warning('Tags cache: Redis connection error')
114+
logger.warning("Diff queue: Redis connection error: {0}".format(
115+
e
116+
))
115117

116118
if data is not None:
117119
return toolkit.response(data=data, raw=True)
@@ -126,8 +128,10 @@ def wrapper(namespace, repository, *args, **kwargs):
126128
cache.redis_conn.setex('{0}:{1}'.format(
127129
cache.cache_prefix, tag_path
128130
), tags_cache_ttl, data)
129-
except cache.redis.exceptions.ConnectionError:
130-
logger.warning('Tags cache: Redis connection error')
131+
except redis.exceptions.ConnectionError as e:
132+
logger.warning("Diff queue: Redis connection error: {0}".format(
133+
e
134+
))
131135

132136
return toolkit.response(data=data, headers=headers,
133137
raw=True)

0 commit comments

Comments
 (0)