From ae0cf85e4f08d1611f67b7cce4799e1077509016 Mon Sep 17 00:00:00 2001 From: Andrew Wang Date: Sat, 4 Sep 2021 11:26:37 -0400 Subject: [PATCH] fix catching wrong exception --- ceod/db/MySQLService.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ceod/db/MySQLService.py b/ceod/db/MySQLService.py index 0f3f337..cd5a870 100644 --- a/ceod/db/MySQLService.py +++ b/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: