Skip to content

CONV-293: Add API domain exception mapping#253

Merged
menvil merged 1 commit into
developfrom
feature/CONV-293-add-api-domain-exception-mapping
Jun 3, 2026
Merged

CONV-293: Add API domain exception mapping#253
menvil merged 1 commit into
developfrom
feature/CONV-293-add-api-domain-exception-mapping

Conversation

@menvil

@menvil menvil commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds ApiExceptionMapper mapping domain exceptions to stable API error codes
  • Adds MappedApiError DTO carrying code/message/status/details
  • Wires mapper into bootstrap/app.php exception renderer for api/* requests
  • Domain exceptions never leak raw messages; web UI rendering is unaffected

Test plan

  • Unit tests for all 9 mapped exception types
  • Feature tests verify mapping fires on real API routes (402/422/413/429)
  • composer test passes (535 tests)
  • composer lint passes

🤖 Generated with Claude Code


Summary by cubic

Standardizes API error responses by mapping domain exceptions to stable error codes and HTTP statuses for api/* routes. Supports CONV-293 and keeps the web UI behavior unchanged.

  • New Features
    • Added ApiExceptionMapper covering 9 domain and framework exceptions (e.g., unsupported format, invalid options, rate limit).
    • Introduced MappedApiError DTO (code, message, status, details).
    • Wired mapping into bootstrap/app.php to return JSON { error: { code, message, details } } with correct status.
    • Added unit and feature tests to verify mappings (e.g., 402/413/422/429).

Written for commit edfabc2. Summary will update on new commits.

Review in cubic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@menvil menvil merged commit 759a3c5 into develop Jun 3, 2026
1 check was pending
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • release

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

Run ID: b926bd59-ecf9-4be7-ac78-d94a2c6cc724

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/CONV-293-add-api-domain-exception-mapping

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 and usage tips.

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.

1 participant