comparison mercurial/error.py @ 45799:0fc8b066928a

errors: name arguments to ParseError constructor As with similar previous patches, this is to improve readability. Differential Revision: https://phab.mercurial-scm.org/D9240
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 22 Oct 2020 09:58:05 -0700
parents 5bb900885311
children 8f07f5a9c3de
comparison
equal deleted inserted replaced
45798:5bb900885311 45799:0fc8b066928a
221 __bytes__ = _tobytes 221 __bytes__ = _tobytes
222 222
223 223
224 class ParseError(Hint, Exception): 224 class ParseError(Hint, Exception):
225 """Raised when parsing config files and {rev,file}sets (msg[, pos])""" 225 """Raised when parsing config files and {rev,file}sets (msg[, pos])"""
226
227 def __init__(self, message, location=None, hint=None):
228 self.message = message
229 self.location = location
230 self.hint = hint
231 # Pass the message and possibly location into the Exception constructor
232 # to help code that looks for exc.args.
233 if location is not None:
234 Exception.__init__(self, message, location)
235 else:
236 Exception.__init__(self, message)
226 237
227 __bytes__ = _tobytes 238 __bytes__ = _tobytes
228 239
229 240
230 class PatchError(Exception): 241 class PatchError(Exception):