Skip to content

fix(api): masking service errors as conflict - #4425

Merged
chrisgacsal merged 1 commit into
mainfrom
fix/currency-err
May 26, 2026
Merged

chrisgacsal merged 1 commit into
mainfrom
fix/currency-err

Conversation

@chrisgacsal

@chrisgacsal chrisgacsal commented May 25, 2026 •

Copy link
Copy Markdown
Collaborator

Overview

Fix all errors returned by create endpoint for Currency API wrapped as conflict errors.

Summary by CodeRabbit

  • Bug Fixes
    • Updated currency creation error handling to provide more accurate error messages when operations fail.

Review Change Stack

@chrisgacsal chrisgacsal self-assigned this May 25, 2026
@chrisgacsal
chrisgacsal requested a review from a team as a code owner May 25, 2026 13:51
@chrisgacsal chrisgacsal added the release-note/bug-fix Release note: Bug Fixes label May 25, 2026
@coderabbitai

coderabbitai Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2f0f32b9-fa47-4e41-9d31-5b4e5dfb79d3

📥 Commits

Reviewing files that changed from the base of the PR and between e1a6265 and 3154254.

📒 Files selected for processing (1)
  • api/v3/handlers/currencies/create.go

📝 Walkthrough

Walkthrough

The CreateCurrency HTTP handler's error response changed from wrapping service failures as conflict errors to returning the raw error directly alongside an empty response. Successful currency creation responses remain unchanged.

Changes

Currency creation error response handling

Layer / File(s) Summary
Error response handling in CreateCurrency handler
api/v3/handlers/currencies/create.go
When the currency service call fails, the handler now returns CreateCurrencyResponse{} with the original error instead of translating it to apierrors.NewConflictError. Successful responses continue to return 201 Created with the converted currency object.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title describes fixing error masking as conflict errors, but the summary shows the opposite change: errors are now returned raw instead of being wrapped as conflict errors. Update the title to accurately reflect the change, such as 'fix(api): stop masking service errors as conflict' or 'fix(api): return raw errors from currency creation'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/currency-err

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.

@chrisgacsal
chrisgacsal merged commit 7cf7e19 into main May 26, 2026
33 of 35 checks passed
@chrisgacsal
chrisgacsal deleted the fix/currency-err branch May 26, 2026 09:21

This branch was previously deployed

1 inactive deployment
dev — 3154254f Deployed May 25, 2026 by chrisgacsal via Migration Checks #14621
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/bug-fix Release note: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants