raise EventError when no results are found, to avoid double stderr write (youtube.py)

This commit is contained in:
jesopo 2019-02-14 01:00:16 +00:00
parent 2794d7235b
commit 15fc5f7124

View file

@ -111,7 +111,7 @@ class Module(ModuleManager.BaseModule):
if search_page.data["pageInfo"]["totalResults"] > 0: if search_page.data["pageInfo"]["totalResults"] > 0:
video_id = search_page.data["items"][0]["id"]["videoId"] video_id = search_page.data["items"][0]["id"]["videoId"]
else: else:
event["stderr"].write("No videos found") raise utils.EventError("No videos found")
else: else:
raise utils.EventsResultsError() raise utils.EventsResultsError()
if video_id: if video_id: