Mercurial > public > mercurial-scm > hg
comparison mercurial/error.py @ 46976:f9482db16cef
errors: introduce a class for remote errors
Having an exception for remote errors makes it much easier to exit
with the right detailed exit code.
Differential Revision: https://phab.mercurial-scm.org/D10466
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 19 Apr 2021 09:37:01 -0700 |
parents | 14ddb1dca2c0 |
children | abd18d6306f1 |
comparison
equal
deleted
inserted
replaced
46975:14ddb1dca2c0 | 46976:f9482db16cef |
---|---|
302 from .i18n import _ | 302 from .i18n import _ |
303 | 303 |
304 Abort.__init__(self, _(b'response expected')) | 304 Abort.__init__(self, _(b'response expected')) |
305 | 305 |
306 | 306 |
307 class OutOfBandError(Abort): | 307 class RemoteError(Abort): |
308 """Exception raised when interacting with a remote repo fails""" | |
309 | |
310 | |
311 class OutOfBandError(RemoteError): | |
308 """Exception raised when a remote repo reports failure""" | 312 """Exception raised when a remote repo reports failure""" |
309 | 313 |
310 def __init__(self, *messages, **kwargs): | 314 def __init__(self, *messages, **kwargs): |
311 from .i18n import _ | 315 from .i18n import _ |
312 | 316 |