Fix StreamResponse status fallback for non-streaming errors#2416
Fix StreamResponse status fallback for non-streaming errors#2416
Conversation
WalkthroughAdded a helper method Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 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 |
Greptile SummaryFixes error handling in
Confidence Score: 5/5
Important Files Changed
Flowchartflowchart TD
A[process_response_chunks called] --> B{response_has_error_status?}
B --> C{is HTTPX::ErrorResponse?}
C -->|Yes| D[Return true - collect error body]
C -->|No| E{response.status >= 400?}
E -->|Yes| D
E -->|No| F[Return false - yield chunk]
E -->|NoMethodError| G[Rescue NoMethodError]
G --> D
D --> H[Append chunk to error_body]
F --> I[Yield processed chunk to caller]
Last reviewed commit: 2284910 |
|
@AbanoubGhadban @ihabadham @alexeyr-ci2 This was done independently by codex. |
Summary
StreamRequest#process_response_chunksto treat responses as errors whenstatusdelegation raisesNoMethodErrorStreamResponsecannot answer#statusCloses #2408
Test plan
bundle exec rspec react_on_rails_pro/spec/react_on_rails_pro/stream_request_spec.rb2.6.10) vs project requirement (>= 3.0.0)Summary by CodeRabbit
Bug Fixes
Tests