Skip to content

Commit

Permalink
api - log operational error
Browse files Browse the repository at this point in the history
  • Loading branch information
cherusk committed Nov 15, 2023
1 parent d898276 commit 76ba440
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/archive_db.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import psycopg2
import logging

class archive_db():

Expand All @@ -16,7 +17,7 @@ def execute(db_info=None, query=""):
db_cursor.execute(query)

except psycopg2.OperationalError as Error:
print(f"Error connecting to the database : {Error}")
logging.error(f"Error connecting to the database : {Error}")

finally:
if db_connection:
Expand Down

0 comments on commit 76ba440

Please sign in to comment.