Skip to content

fix(services): Improve status code consistency - #1090

Open
vprashrex wants to merge 3 commits into
mainfrom
fix/834-status-code-consistency
Open

fix(services): Improve status code consistency#1090
vprashrex wants to merge 3 commits into
mainfrom
fix/834-status-code-consistency

Conversation

@vprashrex

@vprashrex vprashrex commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Issue

Closes #PLEASE_TYPE_ISSUE_NUMBER

Summary

  • Before: Error handling was generic and lacked specific exceptions.
  • Now: Implemented domain-specific exceptions for better granularity and traceability in error handling.
  • Updated error logging to include exception details.
  • Modified HTTP status codes in tests and service methods to conform to new conventions.

Checklist

Before submitting a pull request, please ensure that you mark these task.

  • Ran fastapi run --reload app/main.py or docker compose up in the repository root and test.
  • If you've fixed a bug or added code that is tested and has test cases.

Notes

Please add here if any other information is required for the reviewer.

Original PR description
  • 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.

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.

  • Ran fastapi run --reload app/main.py or docker compose up in the repository root and test.
  • If you've fixed a bug or added code that is tested and has test cases.

Notes

Please add here if any other information is required for the reviewer.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ready-for-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c814846b-775e-43a3-af77-3df9c7074a4c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot changed the title Refactor error handling across services to use domain-specific exceptions refactor(services): Improve error handling structure Jul 29, 2026
@vprashrex
vprashrex changed the base branch from feat/claude-skill-plan-creator to main July 29, 2026 04:25
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

OpenAPI changes   ⚪ No API surface changes

Note

This PR does not modify the API contract.

main31671016 · generated by oasdiff

…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.
@vprashrex
vprashrex force-pushed the fix/834-status-code-consistency branch from 2898d88 to 10ed0a4 Compare July 29, 2026 04:33
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

…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.
@vprashrex vprashrex changed the title refactor(services): Improve error handling structure fix(services): Improve status code consistency Jul 29, 2026
@vprashrex vprashrex linked an issue Jul 31, 2026 that may be closed by this pull request
@vprashrex vprashrex self-assigned this Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Observability: Improve status codes consistency

1 participant