Skip to content

Commit b02b2b9

Browse files
authored
Fix query version rollback when used with older proxies
1 parent e70b016 commit b02b2b9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/borneo/serdeutil.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,10 @@ def map_exception(code, msg):
353353
elif code == SerdeUtil.THROTTLING_ERROR.WRITE_LIMIT_EXCEEDED:
354354
return WriteThrottlingException(msg)
355355
elif code == SerdeUtil.USER_ERROR.BAD_PROTOCOL_MESSAGE:
356+
# newer proxies will return USER_ERROR.UNSUPPORTED_QUERY_VERSION
357+
# but older ones don't have that error but do have a defined string
358+
if 'Invalid query version' in msg:
359+
return UnsupportedQueryVersionException(msg)
356360
# V2 proxy will return this message if V3 is used in the driver
357361
if "Invalid driver serial version" in msg:
358362
return UnsupportedProtocolException(msg)

0 commit comments

Comments
 (0)