Log the exceptions that cause RSSAssistFailed.
This commit is contained in:
parent
b88e816347
commit
54082e82aa
1 changed files with 5 additions and 1 deletions
|
@ -3,6 +3,7 @@ import bs4
|
||||||
# away instead of when bs4 tries to parse.
|
# away instead of when bs4 tries to parse.
|
||||||
import lxml
|
import lxml
|
||||||
import requests
|
import requests
|
||||||
|
import traceback
|
||||||
|
|
||||||
from voussoirkit import vlogging
|
from voussoirkit import vlogging
|
||||||
|
|
||||||
|
@ -31,14 +32,17 @@ def get_user_videos(channel_id):
|
||||||
try:
|
try:
|
||||||
return _get_user_videos(channel_id)
|
return _get_user_videos(channel_id)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
raise exceptions.RSSAssistFailed(f'Failed to fetch RSS videos.') from exc
|
log.warning(traceback.format_exc())
|
||||||
|
raise exceptions.RSSAssistFailed(f'Failed to fetch RSS videos ({exc}).') from exc
|
||||||
|
|
||||||
def get_user_videos_since(channel_id, video_id):
|
def get_user_videos_since(channel_id, video_id):
|
||||||
'''
|
'''
|
||||||
Return the list of video ids that are more recently released than the
|
Return the list of video ids that are more recently released than the
|
||||||
reference id.
|
reference id.
|
||||||
'''
|
'''
|
||||||
|
# Let RSSAssistFailed raise.
|
||||||
video_ids = get_user_videos(channel_id)
|
video_ids = get_user_videos(channel_id)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
index = video_ids.index(video_id)
|
index = video_ids.index(video_id)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|
Loading…
Reference in a new issue