comparison mercurial/transaction.py @ 45738:5df1655edf42

transaction: use ProgrammingError for when an committed transaction is used It seems to me that ProgrammingError is the right type of error here. Differential Revision: https://phab.mercurial-scm.org/D9215
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 12 Oct 2020 12:52:45 -0700
parents 36f08ae87ef6
children 63edc384d3b7
comparison
equal deleted inserted replaced
45737:b3e8d8e4a40d 45738:5df1655edf42
36 36
37 37
38 def active(func): 38 def active(func):
39 def _active(self, *args, **kwds): 39 def _active(self, *args, **kwds):
40 if self._count == 0: 40 if self._count == 0:
41 raise error.Abort( 41 raise error.ProgrammingError(
42 _( 42 b'cannot use transaction when it is already committed/aborted'
43 b'cannot use transaction when it is already committed/aborted'
44 )
45 ) 43 )
46 return func(self, *args, **kwds) 44 return func(self, *args, **kwds)
47 45
48 return _active 46 return _active
49 47