channel.py: Catch FetchError
Should catch this error to fail gracefully See #227
This commit is contained in:
parent
d361996fc0
commit
a0c51731af
@ -292,7 +292,7 @@ def get_number_of_videos_channel(channel_id):
|
|||||||
try:
|
try:
|
||||||
response = util.fetch_url(url, headers_mobile,
|
response = util.fetch_url(url, headers_mobile,
|
||||||
debug_name='number_of_videos', report_text='Got number of videos')
|
debug_name='number_of_videos', report_text='Got number of videos')
|
||||||
except urllib.error.HTTPError as e:
|
except (urllib.error.HTTPError, util.FetchError) as e:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
print("Couldn't retrieve number of videos")
|
print("Couldn't retrieve number of videos")
|
||||||
return 1000
|
return 1000
|
||||||
|
Loading…
x
Reference in New Issue
Block a user