##// END OF EJS Templates
error: make hintable exceptions reject unknown keyword arguments (API)...
Yuya Nishihara -
r29510:19205a0e default
parent child Browse files
Show More
@@ -18,12 +18,12 b' from __future__ import absolute_import'
18 class Hint(object):
18 class Hint(object):
19 """Mix-in to provide a hint of an error
19 """Mix-in to provide a hint of an error
20
20
21 This should come first in the inheritance list to consume **kw and pass
21 This should come first in the inheritance list to consume a hint and
22 only *args to the exception class.
22 pass remaining arguments to the exception class.
23 """
23 """
24 def __init__(self, *args, **kw):
24 def __init__(self, *args, **kw):
25 super(Hint, self).__init__(*args)
25 self.hint = kw.pop('hint', None)
26 self.hint = kw.get('hint')
26 super(Hint, self).__init__(*args, **kw)
27
27
28 class RevlogError(Hint, Exception):
28 class RevlogError(Hint, Exception):
29 pass
29 pass
@@ -56,9 +56,9 b' def _getstorehashcachename(remotepath):'
56 class SubrepoAbort(error.Abort):
56 class SubrepoAbort(error.Abort):
57 """Exception class used to avoid handling a subrepo error more than once"""
57 """Exception class used to avoid handling a subrepo error more than once"""
58 def __init__(self, *args, **kw):
58 def __init__(self, *args, **kw):
59 self.subrepo = kw.pop('subrepo', None)
60 self.cause = kw.pop('cause', None)
59 error.Abort.__init__(self, *args, **kw)
61 error.Abort.__init__(self, *args, **kw)
60 self.subrepo = kw.get('subrepo')
61 self.cause = kw.get('cause')
62
62
63 def annotatesubrepoerror(func):
63 def annotatesubrepoerror(func):
64 def decoratedmethod(self, *args, **kargs):
64 def decoratedmethod(self, *args, **kargs):
General Comments 0
You need to be logged in to leave comments. Login now