修改 QLAPI 调用校验

This commit is contained in:
whyour
2025-01-30 00:55:48 +08:00
parent 3ab5b0d86b
commit 25e8e8198d
6 changed files with 83 additions and 26 deletions
+3 -3
View File
@@ -29,14 +29,14 @@ def error_handler(func):
f'"{k}": {v.__name__}' for k, v in required_fields.items()
)
raise Exception(
f"unknown error: {func_name}() requires a dictionary with parameters: {{{fields_str}}}"
f"{func_name}() requires a dictionary with parameters: {{{fields_str}}}"
) from None
raise Exception(f"unknown error: {str(e)}") from None
raise Exception(f"{str(e)}") from None
except Exception as e:
error_msg = str(e)
if "Error:" in error_msg:
error_msg = error_msg.split("Error:")[-1].split("\n")[0].strip()
raise Exception(f"unknown error: {error_msg}") from None
raise Exception(f"{error_msg}") from None
return wrapper