-
Notifications
You must be signed in to change notification settings - Fork 975
fix: replace panic with error handling in compatUnaryServerInterceptor #3064
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
base: develop
Are you sure you want to change the base?
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
This PR improves error handling in the compatUnaryServerInterceptor by replacing panics with proper error logging and returning errors to clients when services return invalid responses ((nil, nil) or non-*RPCResult types).
Key changes:
- Added logger import for error logging
- Replaced panic with logged error and proper error response for nil response/nil error case
- Replaced panic with logged error and proper error response for non-RPCResult type case
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3064 +/- ##
===========================================
- Coverage 46.76% 40.33% -6.44%
===========================================
Files 295 457 +162
Lines 17172 32425 +15253
===========================================
+ Hits 8031 13078 +5047
- Misses 8287 18085 +9798
- Partials 854 1262 +408 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e9cca22 to
7b21b77
Compare
7b21b77 to
2d87c85
Compare
|
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.
lgtm



Fix: Replace
panicwith a logged internal error incompatUnaryServerInterceptor, when a service returns(nil, nil)or a non-*RPCResult type.
Why this is needed
Previously, such invalid responses caused the server goroutine to panic.
This change ensures the error is properly logged and returned to the client instead
Related to #3008