fix(backend): Fix failure of get_graph_metadata call on SmartDecisionMaker.py

This commit is contained in:
Zamil Majdy
2025-03-01 19:12:34 +07:00
parent 7747ad8f4c
commit 91b1cc90aa
2 changed files with 4 additions and 2 deletions

View File

@@ -184,7 +184,7 @@ class SmartDecisionMakerBlock(Block):
raise ValueError("Graph ID or Graph Version not found in sink node.")
db_client = get_database_manager_client()
sink_graph_meta = db_client.get_graph_metadata(graph_id.graph_version)
sink_graph_meta = db_client.get_graph_metadata(graph_id, graph_version)
if not sink_graph_meta:
raise ValueError(
f"Sink graph metadata not found: {graph_id} {graph_version}"

View File

@@ -441,7 +441,9 @@ def fastapi_get_service_client(service_type: Type[AS]) -> AS:
except httpx.HTTPStatusError as e:
logger.error(f"HTTP error in {method_name}: {e.response.text}")
error = RemoteCallError.model_validate(e.response.json(), strict=False)
raise EXCEPTION_MAPPING.get(error.type, Exception)(*error.args)
raise EXCEPTION_MAPPING.get(error.type, Exception)(
*(error.args or [str(e)])
)
def close(self):
self.client.close()