diff --git a/src/status/status.py b/src/status/status.py index 07c31b2..5df4c88 100644 --- a/src/status/status.py +++ b/src/status/status.py @@ -130,16 +130,17 @@ def _submit_analysis_status_update(node_analysis_id: str, status: AnalysisHubSta :return: """ if status is not None: - - response = asyncio.run(AsyncClient(base_url=os.getenv('HUB_URL_CORE'), - headers={"accept": "application/json", - "Authorization":f"Bearer {get_hub_token()['hub_token']}"}) - .post(f'/analysis-nodes/{node_analysis_id}', - json={"run_status": status}, - headers=[('Connection', 'close')])) - print(f"resposne status update: {response.json()}") - response.raise_for_status() - + try: + response = asyncio.run(AsyncClient(base_url=os.getenv('HUB_URL_CORE'), + headers={"accept": "application/json", + "Authorization":f"Bearer {get_hub_token()['hub_token']}"}) + .post(f'/analysis-nodes/{node_analysis_id}', + json={"run_status": status}, + headers=[('Connection', 'close')])) + #print(f"resposne status update: {response.json()}") + response.raise_for_status() + except httpx.HTTPStatusError as e: + print(f"Error updating analysis status: {e}") def _get_node_analysis_id(node_id: str, analysis_id: str) -> str: """