diff options
author | Dan Sandler <dsandler@android.com> | 2014-03-09 13:20:02 -0400 |
---|---|---|
committer | David Pursehouse <david.pursehouse@sonymobile.com> | 2014-03-11 05:33:43 +0000 |
commit | 53e902a19b0b80e07ac55966d13c5c84c5b0e8ce (patch) | |
tree | e804b3826be8d5bb6153f2f9f4e482191e8b8642 /error.py | |
parent | 093fdb6587bba081c4d34eb9ea500149b1090280 (diff) | |
download | git-repo-53e902a19b0b80e07ac55966d13c5c84c5b0e8ce.tar.gz |
More verbose errors for NoManifestExceptions.
The old "manifest required for this command -- please run
init" is replaced by a more helpful message that lists the
command repo was trying to execute (with arguments) as well
as the str() of the NoManifestException. For example:
> error: in `sync`: [Errno 2] No such file or directory:
> 'path/to/.repo/manifests/.git/HEAD'
> error: manifest missing or unreadable -- please run init
Other failure points in basic command parsing and dispatch
are more clearly explained in the same fashion.
Change-Id: I6212e5c648bc5d57e27145d55a5391ca565e4149
Diffstat (limited to 'error.py')
-rw-r--r-- | error.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -24,6 +24,13 @@ class ManifestInvalidRevisionError(Exception): | |||
24 | class NoManifestException(Exception): | 24 | class NoManifestException(Exception): |
25 | """The required manifest does not exist. | 25 | """The required manifest does not exist. |
26 | """ | 26 | """ |
27 | def __init__(self, path, reason): | ||
28 | super(NoManifestException, self).__init__() | ||
29 | self.path = path | ||
30 | self.reason = reason | ||
31 | |||
32 | def __str__(self): | ||
33 | return self.reason | ||
27 | 34 | ||
28 | class EditorError(Exception): | 35 | class EditorError(Exception): |
29 | """Unspecified error from the user's text editor. | 36 | """Unspecified error from the user's text editor. |