Mercurial > p > roundup > code
diff roundup/admin.py @ 7427:36916abe36e9
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.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Mon, 29 May 2023 18:12:50 -0400 |
| parents | 6795bd384115 |
| children | f7dc37df61b7 |
line wrap: on
line diff
--- a/roundup/admin.py Sun May 28 22:56:28 2023 -0400 +++ b/roundup/admin.py Mon May 29 18:12:50 2023 -0400 @@ -36,7 +36,7 @@ from roundup import __version__ as roundup_version import roundup.instance from roundup.configuration import (CoreConfig, NoConfigError, OptionUnsetError, - ParsingOptionError, UserConfig) + OptionValueError, ParsingOptionError, UserConfig) from roundup.i18n import _, get_translation from roundup.exceptions import UsageError from roundup.anypy.my_input import my_input @@ -1107,6 +1107,8 @@ tracker = roundup.instance.open(tracker_home) except roundup.instance.TrackerError: raise UsageError(_('Instance has not been installed') % locals()) + except OptionValueError as e: + raise UsageError(e) # is there already a database? if tracker.exists():
