Retry if looking up existing branch check fails

This commit is contained in:
Waqar Ahmed
2021-04-22 06:45:06 +05:00
committed by Waqar Ahmed
parent 4a8b3d823e
commit a8c91a284f
10 changed files with 33 additions and 30 deletions

View File

@@ -2,25 +2,23 @@ import errno
class CallError(Exception):
def __init__(self, errmsg, errno=errno.EFAULT, extra=None):
def __init__(self, errmsg):
self.errmsg = errmsg
self.errno = errno
self.extra = extra
def __str__(self):
return f'[{self.errno}] {self.errmsg}'
return f'[{errno.EFAULT}] {self.errmsg}'
class MissingManifest(CallError):
def __init__(self):
super().__init__('Unable to locate manifest file', errno.ENOENT)
super().__init__('Unable to locate manifest file')
class InvalidManifest(CallError):
def __init__(self):
super().__init__('Invalid manifest file found', errno.EINVAL)
super().__init__('Invalid manifest file found')
class MissingPackagesException(CallError):
def __init__(self, packages):
super().__init__(f'Failed preflight check. Please install {", ".join(packages)!r} packages.', errno.ENOENT)
super().__init__(f'Failed preflight check. Please install {", ".join(packages)!r} packages.')