fix(server): map ERROR_CODE_CANCELLED to gRPC Canceled not Internal#2978
fix(server): map ERROR_CODE_CANCELLED to gRPC Canceled not Internal#2978ManthanNimodiya wants to merge 1 commit into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR adds explicit error-code-to-gRPC-status mapping in the ChangesError code to gRPC status mapping
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@EgeAytin @ucatbas @tolgaozen, have a look when you get chance and lmk for any required changes |
|
I have read the CLA Document and I hereby sign the CLA |
Problem
GetStatus maps all 5xxx error codes to codes.Internal via a range check.
This incorrectly includes ERROR_CODE_CANCELLED (5001), so every context cancellation is logged as ERROR-level ,rpc error: code = Internal desc = ERROR_CODE_CANCELLED, by gRPC interceptors, flooding production logs in distributed mode.
Fix
Added explicit cases before the range fallthrough:
Added error_test.go with 9 test cases.
Closes #2700
Summary by CodeRabbit
Bug Fixes
Tests