Skip to content

Commit e818221

Browse files
committed
Error handling: Use JSON for bundling multiple ConnectionError instances
All `ConnectionError` instances that have been collected will be serialized into JSON now.
1 parent 0046f03 commit e818221

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/crate/client/connection.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# However, if you have executed another commercial license agreement
1919
# with Crate these terms will supersede the license and you may use the
2020
# software solely pursuant to the terms of the relevant commercial agreement.
21+
import json
2122

2223
from verlib2 import Version
2324
from verlib2.packaging.version import InvalidVersion
@@ -212,7 +213,7 @@ def _lowest_server_version(self):
212213
if not lowest or version < lowest:
213214
lowest = version
214215
if connection_errors and len(connection_errors) == server_count:
215-
raise ConnectionError(str(connection_errors))
216+
raise ConnectionError(json.dumps(list(map(str, connection_errors))))
216217
return lowest or Version("0.0.0")
217218

218219
def __repr__(self):

0 commit comments

Comments
 (0)