fix(services): Improve status code consistency - #1090
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
OpenAPI changes ⚪ No API surface changesNote This PR does not modify the API contract.
|
…ions - Updated error logging to include exception information for better traceability. - Introduced `ConflictError`, `UpstreamError`, and `ServiceUnavailableError` for more granular HTTP status codes. - Changed HTTP status codes in various tests and service methods to align with new error handling conventions. - Added tests to ensure correct behavior when handling exceptions, including cases for missing resources, state conflicts, and upstream errors. - Updated documentation to reflect changes in exception handling and status code mappings.
2898d88 to
10ed0a4
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
…s codes - Replaced custom exceptions (InvalidPayloadError, ServiceUnavailableError, etc.) with HTTPException across various services and CRUD operations to standardize error responses. - Updated the exception handling logic in evaluations, guardrails, LLM jobs, STT evaluations, and onboarding to raise HTTPException with appropriate status codes. - Removed references to custom exceptions in tests and replaced them with HTTPException assertions. - Added a new exception taxonomy in app/core/exceptions.py to categorize domain-specific errors. - Updated documentation to reflect changes in exception handling and status code consistency.
…andling in the core
Issue
Closes #PLEASE_TYPE_ISSUE_NUMBER
Summary
Checklist
Before submitting a pull request, please ensure that you mark these task.
fastapi run --reload app/main.pyordocker compose upin the repository root and test.Notes
Please add here if any other information is required for the reviewer.
Original PR description
ConflictError,UpstreamError, andServiceUnavailableErrorfor more granular HTTP status codes.Issue
Closes #PLEASE_TYPE_ISSUE_NUMBER
Summary
Explain the motivation for making this change. What existing problem does the pull request solve?
Checklist
Before submitting a pull request, please ensure that you mark these task.
fastapi run --reload app/main.pyordocker compose upin the repository root and test.Notes
Please add here if any other information is required for the reviewer.