|
|
|
@ -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: |
|
|
|
|