Patchwork D10739: errors: catch the new Error class in scmutil and chgserver

login
register
mail settings
Submitter phabricator
Date May 19, 2021, 5:48 a.m.
Message ID <differential-rev-PHID-DREV-hvr3ophcmth3qfjw2oiy-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49059/
State Superseded
Headers show

Comments

phabricator - May 19, 2021, 5:48 a.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/chgserver.py
  mercurial/scmutil.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -205,7 +205,7 @@ 
         detailed_exit_code = 50
     except error.WdirUnsupported:
         ui.error(_(b"abort: working directory revision cannot be specified\n"))
-    except error.Abort as inst:
+    except error.Error as inst:
         if inst.detailed_exit_code is not None:
             detailed_exit_code = inst.detailed_exit_code
         if inst.coarse_exit_code is not None:
diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py
--- a/mercurial/chgserver.py
+++ b/mercurial/chgserver.py
@@ -515,7 +515,7 @@ 
             if inst.hint:
                 self.ui.error(_(b"(%s)\n") % inst.hint)
             errorraised = True
-        except error.Abort as inst:
+        except error.Error as inst:
             if inst.detailed_exit_code is not None:
                 detailed_exit_code = inst.detailed_exit_code
             self.ui.error(inst.format())