You've already forked oncall
mirror of
https://github.com/linkedin/oncall.git
synced 2025-11-26 23:10:47 +02:00
remove bare exceptions
This commit is contained in:
@@ -5,7 +5,7 @@ from falcon import HTTPNotFound, HTTPInternalServerError
|
|||||||
from . import db
|
from . import db
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger('oncall.app')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class HealthCheck(object):
|
class HealthCheck(object):
|
||||||
@@ -31,13 +31,13 @@ class HealthCheck(object):
|
|||||||
cursor.execute("SELECT VERSION();")
|
cursor.execute("SELECT VERSION();")
|
||||||
cursor.close()
|
cursor.close()
|
||||||
connection.close()
|
connection.close()
|
||||||
except:
|
except Exception:
|
||||||
logger.exception('failed to query DB for healthcheck')
|
logger.exception('failed to query DB for healthcheck')
|
||||||
raise HTTPInternalServerError()
|
raise HTTPInternalServerError()
|
||||||
try:
|
try:
|
||||||
with open(self.path) as f:
|
with open(self.path) as f:
|
||||||
status = f.readline().strip()
|
status = f.readline().strip()
|
||||||
except:
|
except IOError:
|
||||||
logger.error('could not open healthcheck file')
|
logger.error('could not open healthcheck file')
|
||||||
raise HTTPNotFound()
|
raise HTTPNotFound()
|
||||||
resp.content_type = 'text/plain'
|
resp.content_type = 'text/plain'
|
||||||
|
|||||||
Reference in New Issue
Block a user