Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions arangoasync/aql.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ async def explain(
def response_handler(resp: Response) -> Json:
if not resp.is_success:
raise AQLQueryExplainError(resp, request)
return self.deserializer.loads(resp.raw_body)
return Response.format_body(self.deserializer.loads(resp.raw_body))

return await self._executor.execute(request, response_handler)

Expand Down Expand Up @@ -625,7 +625,7 @@ async def validate(self, query: str) -> Result[Json]:
def response_handler(resp: Response) -> Json:
if not resp.is_success:
raise AQLQueryValidateError(resp, request)
return self.deserializer.loads(resp.raw_body)
return Response.format_body(self.deserializer.loads(resp.raw_body))

return await self._executor.execute(request, response_handler)

Expand Down Expand Up @@ -719,7 +719,7 @@ async def create_function(
def response_handler(resp: Response) -> Json:
if not resp.is_success:
raise AQLFunctionCreateError(resp, request)
return self.deserializer.loads(resp.raw_body)
return Response.format_body(self.deserializer.loads(resp.raw_body))

return await self._executor.execute(request, response_handler)

Expand Down Expand Up @@ -760,6 +760,6 @@ def response_handler(resp: Response) -> Json:
if not resp.is_success:
if not (resp.status_code == HTTP_NOT_FOUND and ignore_missing):
raise AQLFunctionDeleteError(resp, request)
return self.deserializer.loads(resp.raw_body)
return Response.format_body(self.deserializer.loads(resp.raw_body))

return await self._executor.execute(request, response_handler)
5 changes: 1 addition & 4 deletions arangoasync/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2592,10 +2592,7 @@ async def edges(
def response_handler(resp: Response) -> Json:
if not resp.is_success:
raise EdgeListError(resp, request)
body = self.deserializer.loads(resp.raw_body)
for key in ("error", "code"):
body.pop(key)
return body
return Response.format_body(self.deserializer.loads(resp.raw_body))

return await self._executor.execute(request, response_handler)

Expand Down
8 changes: 4 additions & 4 deletions arangoasync/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@ async def view(self, name: str) -> Result[Json]:
def response_handler(resp: Response) -> Json:
if not resp.is_success:
raise ViewGetError(resp, request)
return self.deserializer.loads(resp.raw_body)
return Response.format_body(self.deserializer.loads(resp.raw_body))

return await self._executor.execute(request, response_handler)

Expand All @@ -1280,7 +1280,7 @@ async def view_info(self, name: str) -> Result[Json]:
def response_handler(resp: Response) -> Json:
if not resp.is_success:
raise ViewGetError(resp, request)
return self.deserializer.loads(resp.raw_body)
return Response.format_body(self.deserializer.loads(resp.raw_body))

return await self._executor.execute(request, response_handler)

Expand Down Expand Up @@ -2006,7 +2006,7 @@ def response_handler(resp: Response) -> Json:
if not resp.is_success:
raise JWTSecretListError(resp, request)
result: Json = self.deserializer.loads(resp.raw_body)
return result
return Response.format_body(result)

return await self._executor.execute(request, response_handler)

Expand All @@ -2028,7 +2028,7 @@ def response_handler(resp: Response) -> Json:
if not resp.is_success:
raise JWTSecretReloadError(resp, request)
result: Json = self.deserializer.loads(resp.raw_body)
return result
return Response.format_body(result)

return await self._executor.execute(request, response_handler)

Expand Down
Loading