diff options
Diffstat (limited to 'api.py')
-rw-r--r-- | api.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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("/") |