mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 05:36:02 +08:00
SearchApi - Return error message instead of raising a ValueError (#11083)
This commit is contained in:
parent
af2461cccc
commit
17ee731546
@ -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…
x
Reference in New Issue
Block a user