refine error response, add set api-key MD (#178)

This commit is contained in:
KevinHuSh
2024-03-31 19:09:42 +08:00
committed by GitHub
parent 9ff38891ad
commit 121c7a5681
8 changed files with 194 additions and 4 deletions

View File

@ -149,6 +149,9 @@ def server_error_response(e):
if len(e.args) > 1:
return get_json_result(
retcode=RetCode.EXCEPTION_ERROR, retmsg=repr(e.args[0]), data=e.args[1])
if repr(e).find("index_not_found_exception") >=0:
return get_json_result(retcode=RetCode.EXCEPTION_ERROR, retmsg="No chunk found, please upload file and parse it.")
return get_json_result(retcode=RetCode.EXCEPTION_ERROR, retmsg=repr(e))