From bf0ec3c3aa7cdb3c669c1a2f7d89763186106d85 Mon Sep 17 00:00:00 2001 From: lelo Date: Mon, 31 Mar 2025 19:43:28 +0200 Subject: [PATCH] try, except --- analytics.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/analytics.py b/analytics.py index 93da7af..6d0c0be 100644 --- a/analytics.py +++ b/analytics.py @@ -37,8 +37,11 @@ class Database(metaclass=SingletonMeta): # Enable autocommit so we don't have to call commit() after every transaction. self.connection.autocommit = True -# Create a global database instance. -log_db = Database() +try: + # Create a global database instance. + log_db = Database() +except: + print("No access to database. No logs available!!!") def lookup_location(ip, reader): try: