Revert "Raise exception when led update fails"

This reverts commit db566a846b33702661c7a6292981569d2c0c91d7.
This commit is contained in:
CPD 2025-03-12 16:44:28 +01:00
parent c44cfac3af
commit cab06e483e

View File

@ -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()