Skip to content

Commit 52e6d3a

Browse files
authored
Fix: error handling (#765)
1 parent 19b5e47 commit 52e6d3a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/draft_release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ jobs:
5959
with:
6060
repository-url: https://test.pypi.org/legacy/
6161
- name: 'Create a Draft Release'
62+
if: always()
6263
uses: ncipollo/release-action@v1
6364
with:
6465
draft: true

aws_advanced_python_wrapper/utils/mysql_exception_handler.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from typing import List, Optional
1616

17-
from mysql.connector import InterfaceError, OperationalError
17+
from mysql.connector import DatabaseError, InterfaceError
1818

1919
from aws_advanced_python_wrapper.errors import QueryTimeoutError
2020
from aws_advanced_python_wrapper.exception_handling import ExceptionHandler
@@ -52,7 +52,7 @@ def is_network_exception(self, error: Optional[Exception] = None, sql_state: Opt
5252
# e.g. 2013 (HY000): Lost connection to MySQL server during query
5353
return True
5454

55-
if isinstance(error, OperationalError):
55+
if isinstance(error, DatabaseError):
5656
if error.errno in self._NETWORK_ERRORS:
5757
return True
5858
if error.msg is not None and self._UNAVAILABLE_CONNECTION in error.msg:

0 commit comments

Comments
 (0)