[Updated] D10483: errors: remove unnecessary varargs handling from OutOfBandError

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue Apr 20 04:59:52 UTC 2021


Closed by commit rHGabd18d6306f1: errors: remove unnecessary varargs handling from OutOfBandError (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D10483?vs=27085&id=27086

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D10483/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D10483

AFFECTED FILES
  mercurial/error.py

CHANGE DETAILS

diff --git a/mercurial/error.py b/mercurial/error.py
--- a/mercurial/error.py
+++ b/mercurial/error.py
@@ -311,16 +311,15 @@
 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 _
 
-        if messages:
-            message = _(b"remote error:\n%s") % b''.join(messages)
+        if message:
             # 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")
-        super(OutOfBandError, self).__init__(message, **kwargs)
+        super(OutOfBandError, self).__init__(message, hint=hint)
 
 
 class ParseError(Abort):



To: martinvonz, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210420/cc3a4f4d/attachment-0002.html>


More information about the Mercurial-patches mailing list