From 4a54301fe997ea93605d3a5c2514a47780c031af Mon Sep 17 00:00:00 2001 From: Daniel Hatton Date: Tue, 8 Apr 2025 09:45:42 +0100 Subject: [PATCH] Catch bad status codes --- src/murfey/server/api/instrument.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/murfey/server/api/instrument.py b/src/murfey/server/api/instrument.py index a40a58050..4fbd4ffd9 100644 --- a/src/murfey/server/api/instrument.py +++ b/src/murfey/server/api/instrument.py @@ -464,7 +464,10 @@ async def get_rsyncer_info( f"{machine_config.instrument_server_url}/sessions/{session_id}/rsyncer_info", headers={"Authorization": f"Bearer {token}"}, ) as resp: - data = await resp.json() + if resp.status == 200: + data = await resp.json() + else: + data = [] except KeyError: data = [] except Exception: