Skip to content

Commit b9ff851

Browse files
committed
error handling
1 parent 9e9ea15 commit b9ff851

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

nettacker/database/db.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,11 @@ def submit_report_to_db(event):
165165
logger.warn("Could not insert report...")
166166
return False
167167
finally:
168-
cursor.close()
169-
connection.close()
168+
try:
169+
cursor.close()
170+
connection.close()
171+
except Exception:
172+
pass
170173
else:
171174
session.add(
172175
Report(

0 commit comments

Comments
 (0)