[#346] Added correct exception in Chunks parse

Signed-off-by: Dmitriy Zayakin <d.zayakin@yadro.com>
This commit is contained in:
Dmitriy Zayakin 2025-01-13 12:58:29 +03:00
parent 6fe7fef44b
commit 974836f1bd

View file

@ -161,5 +161,5 @@ class ChunksOperations(interfaces.ChunksInterface):
def _parse_object_nodes(self, object_nodes: str) -> list[Chunk]: def _parse_object_nodes(self, object_nodes: str) -> list[Chunk]:
parse_result = json.loads(object_nodes) parse_result = json.loads(object_nodes)
if parse_result.get("errors"): if parse_result.get("errors"):
raise parse_result["errors"] raise RuntimeError(", ".join(parse_result["errors"]))
return [Chunk(**chunk) for chunk in parse_result["data_objects"]] return [Chunk(**chunk) for chunk in parse_result["data_objects"]]