Skip to content

Commit 2c2b0e5

Browse files
committed
Handle traceback when OptionValueError raised during init.
Turn it into a UsageError for now. This causes it to report the failing config option and print the help text for init. Printing the help text may not be needed, but it works for now.
1 parent ba56a4f commit 2c2b0e5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

roundup/admin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
from roundup import __version__ as roundup_version
3737
import roundup.instance
3838
from roundup.configuration import (CoreConfig, NoConfigError, OptionUnsetError,
39-
ParsingOptionError, UserConfig)
39+
OptionValueError, ParsingOptionError, UserConfig)
4040
from roundup.i18n import _, get_translation
4141
from roundup.exceptions import UsageError
4242
from roundup.anypy.my_input import my_input
@@ -1107,6 +1107,8 @@ def do_initialise(self, tracker_home, args):
11071107
tracker = roundup.instance.open(tracker_home)
11081108
except roundup.instance.TrackerError:
11091109
raise UsageError(_('Instance has not been installed') % locals())
1110+
except OptionValueError as e:
1111+
raise UsageError(e)
11101112

11111113
# is there already a database?
11121114
if tracker.exists():

0 commit comments

Comments
 (0)