summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-03-02 12:56:08 -0800
committerShawn O. Pearce <sop@google.com>2009-03-02 12:56:08 -0800
commit559b846b17a5b720c1247d07e292150466f27f96 (patch)
tree1b0c5ed818859db0ef13b943dc005af4fbdd3289 /main.py
parent7c6c64d463d3baa361ef7bef8ff3149134819c96 (diff)
downloadgit-repo-559b846b17a5b720c1247d07e292150466f27f96.tar.gz
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>
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.py b/main.py
index be8da017..f8fcfe2d 100755
--- a/main.py
+++ b/main.py
@@ -29,6 +29,7 @@ import sys
29 29
30from command import InteractiveCommand, PagedCommand 30from command import InteractiveCommand, PagedCommand
31from editor import Editor 31from editor import Editor
32from error import ManifestInvalidRevisionError
32from error import NoSuchProjectError 33from error import NoSuchProjectError
33from error import RepoChangedException 34from error import RepoChangedException
34from manifest import Manifest 35from manifest import Manifest
@@ -94,6 +95,9 @@ class _Repo(object):
94 copts, cargs = cmd.OptionParser.parse_args(argv) 95 copts, cargs = cmd.OptionParser.parse_args(argv)
95 try: 96 try:
96 cmd.Execute(copts, cargs) 97 cmd.Execute(copts, cargs)
98 except ManifestInvalidRevisionError, e:
99 print >>sys.stderr, 'error: %s' % str(e)
100 sys.exit(1)
97 except NoSuchProjectError, e: 101 except NoSuchProjectError, e:
98 if e.name: 102 if e.name:
99 print >>sys.stderr, 'error: project %s not found' % e.name 103 print >>sys.stderr, 'error: project %s not found' % e.name