SearchApi - Return error message instead of raising a ValueError (#11083)

pull/11092/head
SebastjanPrachovskij 1 year ago committed by GitHub
parent af2461cccc
commit 17ee731546
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -45,7 +45,7 @@ class SearchAPI:
def _process_response(res: dict, type: str) -> str:
"""Process response from SearchAPI."""
if "error" in res:
raise ValueError(f"Got error from SearchApi: {res['error']}")
return res["error"]
toret = ""
if type == "text":

@ -45,7 +45,7 @@ class SearchAPI:
def _process_response(res: dict, type: str) -> str:
"""Process response from SearchAPI."""
if "error" in res:
raise ValueError(f"Got error from SearchApi: {res['error']}")
return res["error"]
toret = ""
if type == "text":

@ -45,7 +45,7 @@ class SearchAPI:
def _process_response(res: dict, type: str) -> str:
"""Process response from SearchAPI."""
if "error" in res:
raise ValueError(f"Got error from SearchApi: {res['error']}")
return res["error"]
toret = ""
if type == "text":

@ -45,7 +45,7 @@ class SearchAPI:
def _process_response(res: dict) -> str:
"""Process response from SearchAPI."""
if "error" in res:
raise ValueError(f"Got error from SearchApi: {res['error']}")
return res["error"]
toret = ""
if "transcripts" in res and "text" in res["transcripts"][0]:

Loading…
Cancel
Save