Skip to content

Commit ee623c2

Browse files
committed
Improve handling of unknown errors and add traceback if -v is specified
1 parent 347a58d commit ee623c2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mbed/mbed.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1957,5 +1957,9 @@ def config(toolchain=None, mcu=None, source=False, prefix=None):
19571957
error('OS Error: %s' % e[1], e[0])
19581958
except KeyboardInterrupt as e:
19591959
error('User aborted!', 255)
1960-
1960+
except Exception as e:
1961+
if verbose:
1962+
import traceback
1963+
traceback.print_exc(file=sys.stdout)
1964+
error("Unknown Error: %s" % e, 255)
19611965
sys.exit(status or 0)

0 commit comments

Comments
 (0)