Skip to content

Commit 5f98fb4

Browse files
committed
fix: ignore unpack_bytes error due to mfenniak/pg8000#150
1 parent 64803b9 commit 5f98fb4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mamonsu/plugins/pgsql/driver/connection.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ def query(self, query):
6161
self.connected = True
6262
except ProgrammingError as e:
6363
error_text = '{0}'.format(e)
64-
if error_text == 'no result set':
64+
# unpack_from error can happen if pg8000 was waiting for the response
65+
# from PostgreSQL on the socket but instead got nothing.
66+
# This error happens either due to an unstable network or if
67+
# PostgreSQL fails to send the results for the last queries while restarting
68+
if error_text == 'no result set' or 'unpack_from' in error_text:
6569
return None
6670
else:
6771
raise ProgrammingError(error_text)

0 commit comments

Comments
 (0)