From fec2f2bd7bbdf16fd10927e69f4f19e2d5f2b29c Mon Sep 17 00:00:00 2001 From: Yixuan Qiu Date: Tue, 18 Nov 2025 18:50:21 +0800 Subject: [PATCH] fix: fix the example code of error handling (#47) Co-authored-by: Tomsun28 --- README.md | 4 ++-- README_CN.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8e1675c..e218f3f 100644 --- a/README.md +++ b/README.md @@ -345,9 +345,9 @@ try: ) print(response.choices[0].message.content) -except zai.APIStatusError as err: +except zai.core.APIStatusError as err: print(f"API Status Error: {err}") -except zai.APITimeoutError as err: +except zai.core.APITimeoutError as err: print(f"Request Timeout: {err}") except Exception as err: print(f"Unexpected Error: {err}") diff --git a/README_CN.md b/README_CN.md index 0d7a8a6..e8970dd 100644 --- a/README_CN.md +++ b/README_CN.md @@ -351,9 +351,9 @@ try: ) print(response.choices[0].message.content) -except zai.APIStatusError as err: +except zai.core.APIStatusError as err: print(f"API状态错误: {err}") -except zai.APITimeoutError as err: +except zai.core.APITimeoutError as err: print(f"请求超时: {err}") except Exception as err: print(f"其他错误: {err}")