Mercurial > public > mercurial-scm > hg-stable
diff mercurial/error.py @ 47306:dd339191f2dc
errors: make StorageError subclass Error, attaching an exit code to it
Differential Revision: https://phab.mercurial-scm.org/D10741
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 18 May 2021 21:50:09 -0700 |
parents | 5a75be916316 |
children | 73f52278a158 |
line wrap: on
line diff
--- a/mercurial/error.py Tue May 18 19:33:09 2021 -0700 +++ b/mercurial/error.py Tue May 18 21:50:09 2021 -0700 @@ -91,13 +91,16 @@ """Raised if a command needs to print an error and exit.""" -class StorageError(Hint, Exception): +class StorageError(Error): """Raised when an error occurs in a storage layer. Usually subclassed by a storage-specific exception. """ - __bytes__ = _tobytes + def __init__(self, message, hint=None): + super(StorageError, self).__init__( + message, hint=hint, detailed_exit_code=50 + ) class RevlogError(StorageError):