diff mercurial/error.py @ 23415:cdbb85489c41 stable

hook: raise a more specialized HookAbort exception when a hook fails We need to gracefully handle some aborts for pushkey, especially because it leads to a user-facing crash over the wireprotocols. So we need a more specialized exception to catch.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sat, 29 Nov 2014 19:13:35 -0800
parents 2bd51e61c65e
children 10d02cd18604
line wrap: on
line diff
--- a/mercurial/error.py	Mon Dec 01 15:04:34 2014 -0600
+++ b/mercurial/error.py	Sat Nov 29 19:13:35 2014 -0800
@@ -48,6 +48,12 @@
         Exception.__init__(self, *args)
         self.hint = kw.get('hint')
 
+class HookAbort(Abort):
+    """raised when a validation hook fails, aborting an operation
+
+    Exists to allow more specialized catching."""
+    pass
+
 class ConfigError(Abort):
     """Exception raised when parsing config files"""