diff mercurial/scmutil.py @ 46975:14ddb1dca2c0

errors: make OutOfBandError extend Abort I'm about to create a new `RemoteError` exception and make `OutOfBandError` extend it. This patch prepares for that. Differential Revision: https://phab.mercurial-scm.org/D10465
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 19 Apr 2021 10:49:15 -0700
parents d4ba4d51f85f
children f9482db16cef
line wrap: on
line diff
--- a/mercurial/scmutil.py	Mon Apr 05 12:22:25 2021 +0200
+++ b/mercurial/scmutil.py	Mon Apr 19 10:49:15 2021 -0700
@@ -181,17 +181,6 @@
                 encoding.strtolocal(inst.strerror),
             )
         )
-    except error.OutOfBandError as inst:
-        detailed_exit_code = 100
-        if inst.args:
-            msg = _(b"abort: remote error:\n")
-        else:
-            msg = _(b"abort: remote error\n")
-        ui.error(msg)
-        if inst.args:
-            ui.error(b''.join(inst.args))
-        if inst.hint:
-            ui.error(b'(%s)\n' % inst.hint)
     except error.RepoError as inst:
         ui.error(_(b"abort: %s\n") % inst)
         if inst.hint:
@@ -233,6 +222,8 @@
             detailed_exit_code = 30
         elif isinstance(inst, error.HookAbort):
             detailed_exit_code = 40
+        elif isinstance(inst, error.OutOfBandError):
+            detailed_exit_code = 100
         elif isinstance(inst, error.SecurityError):
             detailed_exit_code = 150
         elif isinstance(inst, error.CanceledError):