-
Notifications
You must be signed in to change notification settings - Fork 56
fix: Update exception type for scheme call #4518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Updates the exception handling in get_cortex_connection_properties to align with the new GrpcErrorInterceptor behavior by catching RuntimeError instead of the previous gRPC-specific _InactiveRpcError, and adds a corresponding changelog entry.
- Replace specific gRPC exception catch with RuntimeError
- Remove now-unused local import of _InactiveRpcError
- Add changelog fragment documenting the change
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/ansys/fluent/core/fluent_connection.py | Broadened caught exception type from _InactiveRpcError to RuntimeError and removed the related local import. |
doc/changelog.d/4518.fixed.md | Added changelog fragment describing the exception handling update. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Description
This change fixes the exception type caught in the get_cortex_connection_properties method of fluent_connection.py. Previously the code only caught grpc._channel._InactiveRpcError — but with the introduction of the GrpcErrorInterceptor, failures may now propagate as RuntimeError.
With this PR:
The except _InactiveRpcError: branch is replaced by except RuntimeError: to correctly intercept failures from the new interceptor path.
Logging and fallback behavior remain unchanged.
A changelog fragment has been added (in doc/changelog.d/4518.fixed.md) to capture this change for release notes.
Motivation & Context
This change is necessary because errors previously not being caught would bubble up and potentially break upstream logic. Ensuring the correct exception is caught maintains expected behavior and stability, especially when using the newer gRPC error interceptor mechanism.
Impact
There should be no user‑facing API change; behavior when connections fail is preserved.