Skip to content

fix: replace bare except clause in ClaudeService.chat_completion#311

Open
nuthalapativarun wants to merge 1 commit intomicrosoft:pre-releasefrom
nuthalapativarun:fix/bare-except-claude-service
Open

fix: replace bare except clause in ClaudeService.chat_completion#311
nuthalapativarun wants to merge 1 commit intomicrosoft:pre-releasefrom
nuthalapativarun:fix/bare-except-claude-service

Conversation

@nuthalapativarun
Copy link
Copy Markdown

Summary

  • Replace bare except: with except Exception: in ClaudeService.chat_completion

Changes

ufo/llm/claude.py — the fallback try/except block that logs the raw response object on API error used a bare except: clause. Changed to except Exception: to avoid suppressing SystemExit or KeyboardInterrupt.

The outer exception handler already uses except Exception as e (correct); this aligns the inner fallback with the same pattern.

Bare except clauses catch SystemExit and KeyboardInterrupt in addition
to regular exceptions. Replace with except Exception in the fallback
response logging block.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant