From d0c373c7d4a9f485799ecb1fd7ffd615197b9b1c Mon Sep 17 00:00:00 2001 From: Diego Cepeda Date: Tue, 1 Feb 2022 11:36:21 -0800 Subject: [PATCH] remove bare exceptions --- src/oncall/healthcheck.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/oncall/healthcheck.py b/src/oncall/healthcheck.py index cf41173..fc4bcc6 100644 --- a/src/oncall/healthcheck.py +++ b/src/oncall/healthcheck.py @@ -5,7 +5,7 @@ from falcon import HTTPNotFound, HTTPInternalServerError from . import db import logging -logger = logging.getLogger('oncall.app') +logger = logging.getLogger(__name__) class HealthCheck(object): @@ -31,13 +31,13 @@ class HealthCheck(object): cursor.execute("SELECT VERSION();") cursor.close() connection.close() - except: + except Exception: logger.exception('failed to query DB for healthcheck') raise HTTPInternalServerError() try: with open(self.path) as f: status = f.readline().strip() - except: + except IOError: logger.error('could not open healthcheck file') raise HTTPNotFound() resp.content_type = 'text/plain'