mirror of
https://git.codelinaro.org/clo/tools/repo.git
synced 2025-06-23 12:50:52 +08:00
Report better errors when a project revision is invalid
If a manifest specifies an invalid revision property, give the user a better error message detaling the problem, instead of an ugly Python traceback with a strange Git error message. Bug: REPO-2 Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
4
main.py
4
main.py
@ -29,6 +29,7 @@ import sys
|
||||
|
||||
from command import InteractiveCommand, PagedCommand
|
||||
from editor import Editor
|
||||
from error import ManifestInvalidRevisionError
|
||||
from error import NoSuchProjectError
|
||||
from error import RepoChangedException
|
||||
from manifest import Manifest
|
||||
@ -94,6 +95,9 @@ class _Repo(object):
|
||||
copts, cargs = cmd.OptionParser.parse_args(argv)
|
||||
try:
|
||||
cmd.Execute(copts, cargs)
|
||||
except ManifestInvalidRevisionError, e:
|
||||
print >>sys.stderr, 'error: %s' % str(e)
|
||||
sys.exit(1)
|
||||
except NoSuchProjectError, e:
|
||||
if e.name:
|
||||
print >>sys.stderr, 'error: project %s not found' % e.name
|
||||
|
Reference in New Issue
Block a user