Fix the error response model#122
Conversation
Make the error response model less strict because the structure of the payload for error responses varies.
📝 WalkthroughWalkthrough
ChangesError response handling
Estimated code review effort: 2 (Simple) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
flame_hub/_exceptions.py (1)
4-12: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd regression coverage for both status-code aliases.
The existing tests cover HTTP fallback, but not
status_code,statusCode, or preservation of a payload value that differs fromr.status_code. Add focused cases for each alias and the fallback path.Also applies to: 68-71
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@flame_hub/_exceptions.py` around lines 4 - 12, Add focused regression tests for ErrorResponse covering both status_code and statusCode validation aliases, plus the HTTP fallback when neither is provided. Verify payload status values are preserved even when they differ from r.status_code, while fallback behavior still uses the response status code.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@flame_hub/_exceptions.py`:
- Around line 4-12: Add focused regression tests for ErrorResponse covering both
status_code and statusCode validation aliases, plus the HTTP fallback when
neither is provided. Verify payload status values are preserved even when they
differ from r.status_code, while fallback behavior still uses the response
status code.
Make the error response model less strict because the structure of the payload for error responses varies.
Summary by CodeRabbit