Skip to content

Commit eb86233

Browse files
committed
mbed dm: Check for missing payload and give a better error message
### Description The error message when you invoke `mbed dm update prepare` without a payload is particularly obtuse, and provides a user with no indication that the payload is missing. This change makes that error message not stink. ### Pull request type [x] Fix [ ] Refactor [ ] Target update [ ] Functionality change [ ] Breaking change
1 parent 1af1a4a commit eb86233

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/device_management.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ def inner(options):
8383
app_name, output_ext
8484
))
8585
options.payload = open(payload_name, "rb")
86+
if not options.payload:
87+
LOG.error("No Payload specified. Please use \"-t\" and \"-m\" or \"-p\" to specify a payload ")
88+
exit(1)
8689
return func(options)
8790
return inner
8891

0 commit comments

Comments
 (0)