##// END OF EJS Templates
error: make HintException a mix-in class not derived from BaseException (API)...
Yuya Nishihara -
r29509:945b4c14 default
parent child Browse files
Show More
@@ -15,12 +15,17 b' from __future__ import absolute_import'
15 15
16 16 # Do not import anything here, please
17 17
18 class HintException(Exception):
18 class Hint(object):
19 """Mix-in to provide a hint of an error
20
21 This should come first in the inheritance list to consume **kw and pass
22 only *args to the exception class.
23 """
19 24 def __init__(self, *args, **kw):
20 Exception.__init__(self, *args)
25 super(Hint, self).__init__(*args)
21 26 self.hint = kw.get('hint')
22 27
23 class RevlogError(HintException):
28 class RevlogError(Hint, Exception):
24 29 pass
25 30
26 31 class FilteredIndexError(IndexError):
@@ -50,10 +55,10 b' class ManifestLookupError(LookupError):'
50 55 class CommandError(Exception):
51 56 """Exception raised on errors in parsing the command line."""
52 57
53 class InterventionRequired(HintException):
58 class InterventionRequired(Hint, Exception):
54 59 """Exception raised when a command requires human intervention."""
55 60
56 class Abort(HintException):
61 class Abort(Hint, Exception):
57 62 """Raised if a command needs to print an error and exit."""
58 63
59 64 class HookLoadError(Abort):
@@ -87,10 +92,10 b' class ResponseExpected(Abort):'
87 92 from .i18n import _
88 93 Abort.__init__(self, _('response expected'))
89 94
90 class OutOfBandError(HintException):
95 class OutOfBandError(Hint, Exception):
91 96 """Exception raised when a remote repo reports failure"""
92 97
93 class ParseError(HintException):
98 class ParseError(Hint, Exception):
94 99 """Raised when parsing config files and {rev,file}sets (msg[, pos])"""
95 100
96 101 class UnknownIdentifier(ParseError):
@@ -102,7 +107,7 b' class UnknownIdentifier(ParseError):'
102 107 self.function = function
103 108 self.symbols = symbols
104 109
105 class RepoError(HintException):
110 class RepoError(Hint, Exception):
106 111 pass
107 112
108 113 class RepoLookupError(RepoError):
General Comments 0
You need to be logged in to leave comments. Login now