Skip to content
Snippets Groups Projects
Commit abd18d6306f1 authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

errors: remove unnecessary varargs handling from OutOfBandError

In my recent D10465, I moved some code over from scmutil into
`OutOfBandError.__init__`. The code was written to deal with an
arbitrary number of `message` arguments to the constructor. It turns
out that we only ever pass 0 or 1. Given that, let's simplify it.

Differential Revision: https://phab.mercurial-scm.org/D10483
parent 75351b8b2082
No related branches found
No related tags found
No related merge requests found
......@@ -311,6 +311,6 @@
class OutOfBandError(RemoteError):
"""Exception raised when a remote repo reports failure"""
def __init__(self, *messages, **kwargs):
def __init__(self, message=None, hint=None):
from .i18n import _
......@@ -315,5 +315,4 @@
from .i18n import _
if messages:
message = _(b"remote error:\n%s") % b''.join(messages)
if message:
# Abort.format() adds a trailing newline
......@@ -319,4 +318,4 @@
# Abort.format() adds a trailing newline
message = message.rstrip(b'\n')
message = _(b"remote error:\n%s") % message.rstrip(b'\n')
else:
message = _(b"remote error")
......@@ -321,6 +320,6 @@
else:
message = _(b"remote error")
super(OutOfBandError, self).__init__(message, **kwargs)
super(OutOfBandError, self).__init__(message, hint=hint)
class ParseError(Abort):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment