diff options
author | W. Trevor King <wking@drexel.edu> | 2009-07-29 15:46:37 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-07-29 15:46:37 -0400 |
commit | 4e8882e74aad64859a16f17fa6bef8c04b33913d (patch) | |
tree | 26078e4fbc9a1176ed4e023e74c4bd7b6db1dcb5 /libbe/cmdutil.py | |
parent | caf0111d9c571ac268c235880e6d18fa512e9efa (diff) | |
download | bugseverywhere-4e8882e74aad64859a16f17fa6bef8c04b33913d.tar.gz |
Added clean messages on bug_from_shortname failure.
So user's don't get confused.
Diffstat (limited to 'libbe/cmdutil.py')
-rw-r--r-- | libbe/cmdutil.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libbe/cmdutil.py b/libbe/cmdutil.py index 853a75a..35d2f9e 100644 --- a/libbe/cmdutil.py +++ b/libbe/cmdutil.py @@ -206,6 +206,15 @@ def underlined(instring): return "%s\n%s" % (instring, "="*len(instring)) +def bug_from_shortname(bugdir, shortname): + """ + Exception translation for the command-line interface. + """ + try: + bug = bugdir.bug_from_shortname(shortname) + except (bugdir.MultipleBugMatches, bugdir.NoBugMatches), e: + raise UserError(e.message) + return bug def _test(): import doctest |