Mercurial > public > mercurial-scm > hg-stable
diff mercurial/error.py @ 39793:b63dee7bd0d9
global: replace most uses of RevlogError with StorageError (API)
When catching errors in storage, we should be catching
StorageError instead of RevlogError. When throwing errors related
to storage, we shouldn't be using RevlogError unless we know
the error stemmed from revlogs. And we only reliably know that
if we're in revlog.py or are inheriting from a type defined in
revlog.py.
Differential Revision: https://phab.mercurial-scm.org/D4655
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 18 Sep 2018 16:47:09 -0700 |
parents | cb65d4b7e429 |
children | f732889abe0e |
line wrap: on
line diff
--- a/mercurial/error.py Tue Sep 18 16:45:13 2018 -0700 +++ b/mercurial/error.py Tue Sep 18 16:47:09 2018 -0700 @@ -283,7 +283,7 @@ Abort.__init__(self, 'failed to update value for "%s/%s"' % (namespace, key)) -class CensoredNodeError(RevlogError): +class CensoredNodeError(StorageError): """error raised when content verification fails on a censored node Also contains the tombstone data substituted for the uncensored data. @@ -291,10 +291,10 @@ def __init__(self, filename, node, tombstone): from .node import short - RevlogError.__init__(self, '%s:%s' % (filename, short(node))) + StorageError.__init__(self, '%s:%s' % (filename, short(node))) self.tombstone = tombstone -class CensoredBaseError(RevlogError): +class CensoredBaseError(StorageError): """error raised when a delta is rejected because its base is censored A delta based on a censored revision must be formed as single patch