10000 Merge pull request #189 from ArangoDB-Community/feature/fallback-host… · arangodb/python-arango@b448ade · GitHub
[go: up one dir, main page]

Skip to content

Commit b448ade

Browse files
authored
Merge pull request #189 from ArangoDB-Community/feature/fallback-host-for-503-errorNum
Add fallback host support for 503 errorNum from server
2 parents 403d74a + 281797b commit b448ade

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arango/connection.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ def prep_response(self, resp: Response, deserialize: bool = True) -> Response:
104104
if isinstance(resp.body, dict):
105105
resp.error_code = resp.body.get("errorNum")
106106
resp.error_message = resp.body.get("errorMessage")
107+
if resp.status_code == resp.error_code == 503:
108+
4887 raise ConnectionError # Fallback to another host
107109
else:
108110
resp.body = resp.raw_body
109111

0 commit comments

Comments
 (0)
0