1
0
mirror of https://github.com/vikstrous/pirate-get synced 2025-01-09 09:59:51 +01:00

show the reason in case of the mirror failure

This commit is contained in:
Michele Guerini Rocco 2019-11-24 11:02:50 +01:00
parent 6642130fc5
commit 095f2d2b38
Signed by: rnhmjoj
GPG Key ID: BFBAF4C975F76450

View File

@ -259,8 +259,9 @@ def connect_mirror(mirror, printer, args):
mode=args.action,
terms=args.search,
mirror=mirror)
except (urllib.error.URLError, socket.timeout, IOError, ValueError):
printer.print('Failed', color='WARN')
except (urllib.error.URLError, socket.timeout, IOError, ValueError) as e:
printer.print('Failed', color='WARN', end=' ')
printer.print('(', e, ')', sep='')
return None
else:
printer.print('Ok', color='alt')