fix logging of exceptions
This commit is contained in:
parent
8c2011ab4a
commit
faf043d037
1 changed files with 6 additions and 6 deletions
12
main.py
12
main.py
|
@ -51,13 +51,13 @@ if "sentry_url" in config and ("debug" not in config or not config["debug"]):
|
|||
|
||||
|
||||
async def fetch(session, url):
|
||||
async with session.get(url) as response:
|
||||
try:
|
||||
try:
|
||||
async with session.get(url) as response:
|
||||
return await response.text()
|
||||
except Exception as e:
|
||||
logging.exception("failed to fetch {url}".format(url=url))
|
||||
if client is not None:
|
||||
client.captureException()
|
||||
except Exception as e:
|
||||
logging.exception("failed to fetch {url}".format(url=url))
|
||||
if 'client' in locals():
|
||||
client.captureException(data={url:url})
|
||||
|
||||
|
||||
async def main(loop, sites):
|
||||
|
|
Reference in a new issue