send mercurial hook error messages to client

This commit is contained in:
Sebastian Sdorra
2013-04-02 21:57:23 +02:00
parent 2e54ff171d
commit db5a17fa9e
2 changed files with 45 additions and 0 deletions

View File

@@ -54,6 +54,12 @@ def callHookUrl(ui, repo, hooktype, node):
abort = False
else:
ui.warn( "ERROR: scm-hook failed with error code " + str(conn.code) + "\n" )
except urllib2.URLError, e:
msg = e.read();
if len(msg) > 0:
ui.warn( "ERROR: " + msg)
else:
ui.warn( "ERROR: scm-hook failed with error code " + str(e.getcode()) + "\n" )
except ValueError:
ui.warn( "scm-hook failed with an exception\n" )
return abort