catch failed to synchronize databases error

This commit is contained in:
JerryXiao 2021-12-19 12:29:23 +08:00
parent b086e950c0
commit 8e5ee014d1
Signed by: Jerry
GPG key ID: 22618F758B5BE2E5

View file

@ -278,7 +278,8 @@ def _log_parser(log: List[str], report: checkReport) -> None:
def sync_err_is_net(output: str) -> bool:
''' check if a sync failure is caused by network '''
output = output.strip().split('\n')
if 'error: failed to synchronize all databases (download library error)' in output:
if 'error: failed to synchronize all databases (download library error)' in output \
or 'error: failed to synchronize all databases (unexpected error)' in output:
return True
else:
return False