From 3fce0af06c7fe059b456721b6c26fee4f7457de2 Mon Sep 17 00:00:00 2001
From: Thomas Kluyver <thomas@kluyver.me.uk>
Date: Fri, 4 Aug 2023 16:53:53 +0100
Subject: [PATCH] Work around errors from empty responses in calibration_client

---
 src/cal_tools/calcat_interface.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/cal_tools/calcat_interface.py b/src/cal_tools/calcat_interface.py
index 43e1519c2..0cc3f86eb 100644
--- a/src/cal_tools/calcat_interface.py
+++ b/src/cal_tools/calcat_interface.py
@@ -236,6 +236,9 @@ class CalCatApi(metaclass=ClientWrapper):
         )
 
         if not resp["success"]:
+            if resp["status_code"] == 200:
+                # calibration_client turns empty response into an error
+                return []
             raise CalCatError(resp)
 
         return resp["data"]
-- 
GitLab