From e489737f5fe717110900798fa60ad2a18ed03562 Mon Sep 17 00:00:00 2001 From: Jaka Date: Sat, 5 Oct 2024 12:21:52 +0200 Subject: [PATCH] Exception for loading from file caught too --- gui/installer.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gui/installer.py b/gui/installer.py index 7819aa0..840b8a6 100644 --- a/gui/installer.py +++ b/gui/installer.py @@ -348,10 +348,15 @@ class ValidationWidget(QWidget): self.load_tapes_from_file() def load_tapes_from_file(self): - with open("./source/tapes.yaml", encoding="utf-8") as fp: - tapes = yaml.safe_load(fp) + try: + with open("./source/tapes.yaml", encoding="utf-8") as fp: + tapes = yaml.safe_load(fp) + self.load_tapes(tapes) + + except yaml.scanner.ScannerError as e: + dlg = DebugDialog(f"Error applying yaml code:\n\n{str(e)}") + dlg.exec() - self.load_tapes(tapes) def load_tapes(self, tapes): self.tapes = tapes