summaryrefslogtreecommitdiff
path: root/editor.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-06-24 07:09:51 -0700
committerShawn O. Pearce <sop@google.com>2009-06-24 07:15:21 -0700
commit54fccd71fbdc60adf99b9a9bf4712c121d4312ba (patch)
treed51eb84344c0433e12335b1000ce3526b1368cf8 /editor.py
parentfb5c8fd948dea211cd8f43477855de44c273a1bf (diff)
downloadgit-repo-54fccd71fbdc60adf99b9a9bf4712c121d4312ba.tar.gz
git-repo-54fccd71fbdc60adf99b9a9bf4712c121d4312ba.zip
Document any crashes from the user's text editorv1.6.8.4
Rather than failing with no information, display the child exit status and the command line we tried to use to edit a text file. There may be some useful information to help understand the crash. Signed-off-by: Shawn O. Pearce <sop@google.com>
Diffstat (limited to 'editor.py')
-rw-r--r--editor.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/editor.py b/editor.py
index 7400ba1af..cf0a5ee53 100644
--- a/editor.py
+++ b/editor.py
@@ -76,8 +76,15 @@ least one of these before using this command."""
os.close(fd)
fd = None
- if subprocess.Popen(editor + [path]).wait() != 0:
- raise EditorError()
+ try:
+ rc = subprocess.Popen(editor + [path]).wait()
+ except OSError, e:
+ raise EditorError('editor failed, %s: %s %s'
+ % (str(e), cls._GetEditor(), path))
+ if rc != 0:
+ raise EditorError('editor failed with exit status %d: %s %s'
+ % (rc, cls._GetEditor(), path))
+
fd2 = open(path)
try:
return fd2.read()