aboutsummaryrefslogtreecommitdiff
path: root/api.py
diff options
context:
space:
mode:
Diffstat (limited to 'api.py')
-rw-r--r--api.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/api.py b/api.py
index db7a881..e7ac8cd 100644
--- a/api.py
+++ b/api.py
@@ -19,13 +19,16 @@ def gen_word(N, min_N_dig, min_N_low):
dbFailing = False
import mysql.connector as con
-from mysql.connector.errors import InterfaceError
+from mysql.connector.errors import InterfaceError, DatabaseError
try:
mycon = con.connect(host=flask_app.config['DB_HOST'],user=flask_app.config['DB_USER'],password=flask_app.config['DB_PASSWORD'],port=flask_app.config['DB_PORT'],database=flask_app.config['DB_NAME'])
mycursor = mycon.cursor()
except InterfaceError:
print("Could not connect to the database!")
dbFailing = True
+except DatabaseError:
+ print("Unknown Host")
+ dbFailing = True
"""
@flask_app.route("/")