scripts: run_common: improve error handling for missing runner
Catch the ValueError returned by get_runner_cls() and turn it in to a
log.die().
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
diff --git a/scripts/west_commands/run_common.py b/scripts/west_commands/run_common.py
index af82787..43f82da 100644
--- a/scripts/west_commands/run_common.py
+++ b/scripts/west_commands/run_common.py
@@ -326,7 +326,10 @@
fatal=True)
log.inf(f'To fix, configure this runner in {board_cmake} and rebuild.')
sys.exit(1)
- runner_cls = get_runner_cls(runner)
+ try:
+ runner_cls = get_runner_cls(runner)
+ except ValueError as e:
+ log.die(e)
if command.name not in runner_cls.capabilities().commands:
log.die(f'runner {runner} does not support command {command.name}')