1
0
mirror of https://github.com/vikstrous/pirate-get synced 2025-01-10 10:04:21 +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, mode=args.action,
terms=args.search, terms=args.search,
mirror=mirror) mirror=mirror)
except (urllib.error.URLError, socket.timeout, IOError, ValueError): except (urllib.error.URLError, socket.timeout, IOError, ValueError) as e:
printer.print('Failed', color='WARN') printer.print('Failed', color='WARN', end=' ')
printer.print('(', e, ')', sep='')
return None return None
else: else:
printer.print('Ok', color='alt') printer.print('Ok', color='alt')