Re-raise Exception on debug mode
This commit is contained in:
parent
e07f0bba18
commit
5ba14adc41
|
@ -261,7 +261,7 @@ class App(object):
|
|||
subcommand = self.command_manager.find_command(argv)
|
||||
except ValueError as err:
|
||||
if self.options.debug:
|
||||
LOG.exception(err)
|
||||
raise
|
||||
else:
|
||||
LOG.error(err)
|
||||
return 2
|
||||
|
|
|
@ -379,3 +379,11 @@ def test_error_encoding_sys():
|
|||
def test_unknown_cmd():
|
||||
app, command = make_app()
|
||||
assert app.run(['hell']) == 2
|
||||
|
||||
|
||||
def test_unknown_cmd_debug():
|
||||
app, command = make_app()
|
||||
try:
|
||||
app.run(['--debug', 'hell']) == 2
|
||||
except ValueError as err:
|
||||
assert "['hell']" in ('%s' % err)
|
||||
|
|
Loading…
Reference in New Issue