Skip to content

Commit

Permalink
Add error handling to cf loader
Browse files Browse the repository at this point in the history
  • Loading branch information
krichardsson committed Dec 1, 2022
1 parent 45ba7e6 commit 221c4ac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cfloader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -162,6 +163,7 @@ def print_info(version: int, connected_targets: [Target]):

traceback.print_exc(file=sys.stdout)
print(e)
sys.exit(-1)

finally:
#########################
Expand Down

0 comments on commit 221c4ac

Please sign in to comment.