mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add GitLockError exception class
This commit is contained in:
parent
ad04ccfb93
commit
06b212519c
1 changed files with 16 additions and 0 deletions
|
@ -121,6 +121,22 @@ class FileLockError(SaltException):
|
|||
self.time_start = time_start
|
||||
|
||||
|
||||
class GitLockError(SaltException):
|
||||
'''
|
||||
Raised when an uncaught error occurs in the midst of obtaining an
|
||||
update/checkout lock in salt.utils.gitfs.
|
||||
|
||||
NOTE: While this uses the errno param similar to an OSError, this exception
|
||||
class is *not* as subclass of OSError. This is done intentionally, so that
|
||||
this exception class can be caught in a try/except without being caught as
|
||||
an OSError.
|
||||
'''
|
||||
def __init__(self, errno, strerror, *args, **kwargs):
|
||||
super(GitLockError, self).__init__(strerror, *args, **kwargs)
|
||||
self.errno = errno
|
||||
self.strerror = strerror
|
||||
|
||||
|
||||
class SaltInvocationError(SaltException, TypeError):
|
||||
'''
|
||||
Used when the wrong number of arguments are sent to modules or invalid
|
||||
|
|
Loading…
Add table
Reference in a new issue