From 221c4ac835ac7bcf7ec20c2b32dd96ca3e2d9868 Mon Sep 17 00:00:00 2001 From: Kristoffer Richardsson Date: Thu, 1 Dec 2022 09:49:08 +0100 Subject: [PATCH] Add error handling to cf loader --- src/cfloader/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cfloader/__init__.py b/src/cfloader/__init__.py index 9f1e1efd..dc4ade3b 100644 --- a/src/cfloader/__init__.py +++ b/src/cfloader/__init__.py @@ -153,6 +153,7 @@ def print_info(version: int, connected_targets: [Target]): bl.flash_full(None, filename, warm_boot, targets) except Exception as e: print("Failed to flash: {}".format(e)) + sys.exit(-1) elif action == "reset": bl.reset_to_firmware() else: @@ -162,6 +163,7 @@ def print_info(version: int, connected_targets: [Target]): traceback.print_exc(file=sys.stdout) print(e) + sys.exit(-1) finally: #########################