[Request] [+ ] D9215: transaction: use ProgrammingError for when an committed transaction is used

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Fri Oct 16 06:02:09 UTC 2020


martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  It seems to me that ProgrammingError is the right type of error here.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/transaction.py

CHANGE DETAILS

diff --git a/mercurial/transaction.py b/mercurial/transaction.py
--- a/mercurial/transaction.py
+++ b/mercurial/transaction.py
@@ -38,10 +38,8 @@
 def active(func):
     def _active(self, *args, **kwds):
         if self._count == 0:
-            raise error.Abort(
-                _(
-                    b'cannot use transaction when it is already committed/aborted'
-                )
+            raise error.ProgrammingError(
+                b'cannot use transaction when it is already committed/aborted'
             )
         return func(self, *args, **kwds)
 



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


More information about the Mercurial-patches mailing list