Skip to content

Commit cbc02e2

Browse files
committed
error handling
1 parent 3a14b81 commit cbc02e2

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)