Skip to content

Commit 9d7b47b

Browse files
Narrow exception handling in index view
1 parent d61c876 commit 9d7b47b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

listenbrainz/webserver/views/index.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@ def current_status():
107107
day = datetime.today() - relativedelta(days=delta)
108108
try:
109109
day_listen_count = _redis.get_listen_count_for_day(day)
110-
except:
110+
except Exception:
111111
current_app.logger.error("Could not get %s listen count from redis", day.strftime('%Y-%m-%d'), exc_info=True)
112112
day_listen_count = None
113-
listen_counts_per_day.append({
114-
"date": day.strftime('%Y-%m-%d'),
115-
"listenCount": format(day_listen_count, ',d') if day_listen_count else "0",
116-
"label": "today" if delta == 0 else "yesterday",
117-
})
113+
listen_counts_per_day.append({
114+
"date": day.strftime('%Y-%m-%d'),
115+
"listenCount": format(day_listen_count, ',d') if day_listen_count else "0",
116+
"label": "today" if delta == 0 else "yesterday",
117+
})
118118

119119
data = {
120120
"load": load,

0 commit comments

Comments
 (0)