Skip to content

refactor: upgrade error handling and replace print with standard logging in scripts/openai_compat_live_check.py#349

Merged
Soju06 merged 2 commits intoSoju06:mainfrom
Felix201209:felixypz/refactor-openai-compat-logging-2
Apr 8, 2026
Merged

refactor: upgrade error handling and replace print with standard logging in scripts/openai_compat_live_check.py#349
Soju06 merged 2 commits intoSoju06:mainfrom
Felix201209:felixypz/refactor-openai-compat-logging-2

Conversation

@Felix201209
Copy link
Copy Markdown
Contributor

This PR enhances observability and safety by removing broad exception catches and integrating proper logging, ensuring safer production deployments.

Changes include:

  • replacing runtime print statements with standard logging calls
  • narrowing broad exception handlers to context-specific exception types

Copilot AI review requested due to automatic review settings April 7, 2026 11:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors scripts/openai_compat_live_check.py to improve runtime observability by switching from print() to Python’s standard logging and by narrowing overly broad exception handling.

Changes:

  • Added a module logger and configured basic logging in main().
  • Replaced runtime print() statements with logger.info() / logger.error().
  • Narrowed exception handling in _error_detail() when extracting response bodies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/openai_compat_live_check.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Soju06
Copy link
Copy Markdown
Owner

Soju06 commented Apr 8, 2026

@all-contributors please add @Felix201209 for code

@Soju06 Soju06 merged commit a8cbefa into Soju06:main Apr 8, 2026
1 check passed
@allcontributors
Copy link
Copy Markdown
Contributor

@Soju06

I've put up a pull request to add @Felix201209! 🎉

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.

3 participants