Skip to content

fix: replace bare except clauses in LlavaService and CogAgentService#313

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

fix: replace bare except clauses in LlavaService and CogAgentService#313
nuthalapativarun wants to merge 1 commit intomicrosoft:pre-releasefrom
nuthalapativarun:fix/bare-except-llava-cogagent

Conversation

@nuthalapativarun
Copy link
Copy Markdown

Summary

  • Replace bare except: with except Exception: in LlavaService and CogAgentService

Changes

ufo/llm/llava.py and ufo/llm/cogagent.py — both services share the same retry pattern: on API error the outer except Exception as e logs the error, then a nested try/except attempts to log the raw response object. The inner except was bare, which can suppress SystemExit and KeyboardInterrupt. Changed to except Exception: to match the outer handler.

Both services use the same retry pattern where a fallback try/except
logs the raw response object on API error. The inner except was bare,
catching SystemExit and KeyboardInterrupt unintentionally.
Replace with except Exception to match the outer handler pattern.
@nuthalapativarun
Copy link
Copy Markdown
Author

@nuthalapativarun please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

@nuthalapativarun
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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