From cab06e483e56a141f701c899893d49981539227a Mon Sep 17 00:00:00 2001 From: CPD Date: Wed, 12 Mar 2025 16:44:28 +0100 Subject: [PATCH] Revert "Raise exception when led update fails" This reverts commit db566a846b33702661c7a6292981569d2c0c91d7. --- cpdctrl/measurement.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cpdctrl/measurement.py b/cpdctrl/measurement.py index 94703ba..bdb08bc 100644 --- a/cpdctrl/measurement.py +++ b/cpdctrl/measurement.py @@ -154,18 +154,17 @@ def measure( led_dev.set_level(new_led_val) led_val = new_led_val except Exception as e: - log.error(f"Error setting led to {new_led_val:03}%: {e}") - raise e + log.error("Error setting led to {new_led_val}%: {e}") except KeyboardInterrupt: - log.info("Keyboard interrupt, stopping measurement") + log.info("Keyboard interrupt, stopping") except Exception as e: - log.critical(f"Unexpected error, stopping measurement. Error: {e}") + log.critical(f"Unexpected error, stopping. Error: {e}") if add_measurement_info_to_metadata: data.metadata["measurement_time_stop"] = get_time() # Write again after having updated the stop time data.write_metadata() - data.flush() + data.flush(verbose=verbose) led_dev.off()