diff -r 3c9208702db3 -r 14ddb1dca2c0 mercurial/error.py --- a/mercurial/error.py Mon Apr 05 12:22:25 2021 +0200 +++ b/mercurial/error.py Mon Apr 19 10:49:15 2021 -0700 @@ -304,10 +304,19 @@ Abort.__init__(self, _(b'response expected')) -class OutOfBandError(Hint, Exception): +class OutOfBandError(Abort): """Exception raised when a remote repo reports failure""" - __bytes__ = _tobytes + def __init__(self, *messages, **kwargs): + from .i18n import _ + + if messages: + message = _(b"remote error:\n%s") % b''.join(messages) + # Abort.format() adds a trailing newline + message = message.rstrip(b'\n') + else: + message = _(b"remote error") + super(OutOfBandError, self).__init__(message, **kwargs) class ParseError(Abort):