catch unable to connect to mysql db

pull/15/head
Andrew Wang 1 year ago
parent b63c5b4487
commit 9917635dc8
  1. 4
      ceod/db/MySQLService.py

@ -10,7 +10,7 @@ from ceod.utils import gen_password
from ceod.db.utils import response_is_empty
from mysql.connector import connect
from mysql.connector.errors import InterfaceError, ProgrammingError
from mysql.connector.errors import OperationalError, ProgrammingError
logger = logger_factory(__name__)
@ -35,7 +35,7 @@ class MySQLService:
password=self.auth_password,
) as con:
yield con
except InterfaceError as e:
except OperationalError as e:
logger.error(e)
raise DatabaseConnectionError()
except ProgrammingError as e:

Loading…
Cancel
Save