mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-03-04 07:43:46 +08:00
fix: replace bare except clauses with except Exception
Bare `except:` catches BaseException including KeyboardInterrupt and SystemExit. Replaced 29 instances with `except Exception:`.
This commit is contained in:
@@ -383,7 +383,7 @@ class ClaudeAPIBot(Bot, OpenAIImage):
|
||||
try:
|
||||
error_data = json.loads(error_text)
|
||||
error_msg = error_data.get("error", {}).get("message", error_text)
|
||||
except:
|
||||
except Exception:
|
||||
error_msg = error_text or "Unknown error"
|
||||
|
||||
yield {
|
||||
|
||||
Reference in New Issue
Block a user