diff options
| author | Shawn O. Pearce <sop@google.com> | 2009-03-02 12:56:08 -0800 |
|---|---|---|
| committer | Shawn O. Pearce <sop@google.com> | 2009-03-02 12:56:08 -0800 |
| commit | 559b846b17a5b720c1247d07e292150466f27f96 (patch) | |
| tree | 1b0c5ed818859db0ef13b943dc005af4fbdd3289 /main.py | |
| parent | 7c6c64d463d3baa361ef7bef8ff3149134819c96 (diff) | |
| download | git-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-x | main.py | 4 |
1 files changed, 4 insertions, 0 deletions
| @@ -29,6 +29,7 @@ import sys | |||
| 29 | 29 | ||
| 30 | from command import InteractiveCommand, PagedCommand | 30 | from command import InteractiveCommand, PagedCommand |
| 31 | from editor import Editor | 31 | from editor import Editor |
| 32 | from error import ManifestInvalidRevisionError | ||
| 32 | from error import NoSuchProjectError | 33 | from error import NoSuchProjectError |
| 33 | from error import RepoChangedException | 34 | from error import RepoChangedException |
| 34 | from manifest import Manifest | 35 | from 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 |
