From fbd299c7e7cf548886e2b1787d8e188c708ee8cd Mon Sep 17 00:00:00 2001 From: wyzula-jan <133381102+wyzula-jan@users.noreply.github.com> Date: Tue, 3 Oct 2023 11:23:51 +0200 Subject: [PATCH] fix: extreme.py improved error handling for scan types mode --- bec_widgets/examples/extreme/extreme.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bec_widgets/examples/extreme/extreme.py b/bec_widgets/examples/extreme/extreme.py index 1f8e232f..cc2d3c04 100644 --- a/bec_widgets/examples/extreme/extreme.py +++ b/bec_widgets/examples/extreme/extreme.py @@ -403,7 +403,19 @@ class PlotApp(QWidget): self.plot_data = self.plot_data_config elif self.scan_types is True: currentName = metadata.get("scan_name") + if currentName is None: + raise ValueError( + f"Scan name not found in metadata. Please check the scan_name in the YAML config or in bec " + f"configuration." + ) + return self.plot_data = self.plot_data_config.get(currentName, []) + if self.plot_data == []: + raise ValueError( + f"Scan name {currentName} not found in the YAML config. Please check the scan_name in the " + f"YAML config or in bec configuration." + ) + return # Init UI self.init_ui(self.plot_settings["num_columns"])