From 53e902a19b0b80e07ac55966d13c5c84c5b0e8ce Mon Sep 17 00:00:00 2001 From: Dan Sandler Date: Sun, 9 Mar 2014 13:20:02 -0400 Subject: 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 --- project.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'project.py') diff --git a/project.py b/project.py index d07b5216..023cf732 100644 --- a/project.py +++ b/project.py @@ -2327,8 +2327,8 @@ class Project(object): path = os.path.join(self._project.worktree, '.git', HEAD) try: fd = open(path, 'rb') - except IOError: - raise NoManifestException(path) + except IOError as e: + raise NoManifestException(path, str(e)) try: line = fd.read() finally: -- cgit v1.2.3-54-g00ecf