aboutsummaryrefslogtreecommitdiffstats
path: root/database.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2023-10-07 17:38:50 +0100
committerjwansek <eddie.atten.ea29@gmail.com>2023-10-07 17:38:50 +0100
commit8d804ec551d8866325a56643adae34d399280327 (patch)
tree4372af0c62802b0863e2e1c28778a592d4ffaf6c /database.py
parent88647d26fe0c38a09cfa39fcb3d09125f9f9e955 (diff)
downloadpower.eda.gay-8d804ec551d8866325a56643adae34d399280327.tar.gz
power.eda.gay-8d804ec551d8866325a56643adae34d399280327.zip
Fixed retrying if it couldn't connect
Diffstat (limited to 'database.py')
-rw-r--r--database.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/database.py b/database.py
index 59250d0..b31f905 100644
--- a/database.py
+++ b/database.py
@@ -23,6 +23,8 @@ class PowerDatabase:
print(e)
if e.args[0] == 1049:
self.__connection = self.__build_db()
+ elif e.args[0] == 2003:
+ raise ConnectionError(e.args[1])
with self.__connection.cursor() as cursor:
if "TASMOTA_DEVICES" in os.environ.keys():