Skip to content

Commit 00612f7

Browse files
committed
bin\litscan-retracted-articles.py broad-exception-caught
As discussed, narrowed Exception to ValueError
1 parent ba4a8bf commit 00612f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: bin/litscan-retracted-articles.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def main(database, webhook):
7777
message = f'{len(retracted_articles)} {"articles have" if len(retracted_articles) > 1 else "article has"} ' \
7878
f'been retracted: {", ".join(retracted_articles)}'
7979
requests.post(webhook, json.dumps({"text": message}))
80-
except (Exception, psycopg2.DatabaseError) as error:
80+
except (ValueError, psycopg2.DatabaseError) as error:
8181
requests.post(webhook, json.dumps({"text": error}))
8282
finally:
8383
if conn is not None:

0 commit comments

Comments
 (0)