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

Merge pull request #123 from moraisaugusto/improve_error

give more detail on error
This commit is contained in:
Viktor Stanchev 2018-09-18 22:34:04 -07:00 committed by GitHub
commit 7b2d0795cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,8 +181,9 @@ def save_torrents(printer, chosen_links, results, folder):
try:
torrent = get_torrent(info_hash)
except urllib.error.HTTPError:
printer.print('There is no cached file for this torrent :(',
except urllib.error.HTTPError as e:
printer.print('There is no cached file for this torrent :('
' \nCode: {} - {}'.format(e.code, e.reason),
color='ERROR')
else:
open(file, 'wb').write(torrent)