on master help sign in
Propagate error messages from YouTube API
e158eeeNoémi Ványi
searx/engines/youtube_api.py+3
@@ -47,6 +47,9 @@ def response(resp):
47
47
48 search_results = loads(resp.text)
48 search_results = loads(resp.text)
49
49
50+ if 'error' in search_results and 'message' in search_results['error']:
51+ raise Exception(search_results['error']['message'])
52+
50 # return empty array if there are no results
53 # return empty array if there are no results
51 if 'items' not in search_results:
54 if 'items' not in search_results:
52 return []
55 return []