8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9dcefe9 commit c3e5a63Copy full SHA for c3e5a63
pymysql/err.py
@@ -100,5 +100,7 @@ def _map_error(exc, *errors):
100
def raise_mysql_exception(data):
101
errno = struct.unpack('<h', data[1:3])[0]
102
errval = data[9:].decode('utf-8', 'replace')
103
- errorclass = error_map.get(errno, InternalError)
+ errorclass = error_map.get(errno)
104
+ if errorclass is None:
105
+ errorclass = InternalError if errno < 1000 else OperationalError
106
raise errorclass(errno, errval)
0 commit comments