scripts: runners: improve error handling CLI
Catch RuntimeError when calling runner.run() and print a message instead of dumping stack unless in verbose mode. This improves the command line interface when runners raise exceptions. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
parent
136d92de33
commit
8837469492
1 changed files with 6 additions and 0 deletions
|
@ -295,6 +295,12 @@ def do_run_common(command, args, runner_args, cached_runner_var):
|
|||
except MissingProgram as e:
|
||||
log.die('required program', e.filename,
|
||||
'not found; install it or add its location to PATH')
|
||||
except RuntimeError as re:
|
||||
if not args.verbose:
|
||||
log.die(re)
|
||||
else:
|
||||
log.err('verbose mode enabled, dumping stack:', fatal=True)
|
||||
raise
|
||||
|
||||
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue