Skip to content
This repository was archived by the owner on Jul 14, 2026. It is now read-only.

💄 Create custom error messages for scan failure#308

Merged
Ruby11235 merged 2 commits into
mainfrom
fix/fix-error-messages
Jul 14, 2026
Merged

💄 Create custom error messages for scan failure#308
Ruby11235 merged 2 commits into
mainfrom
fix/fix-error-messages

Conversation

@Ruby11235

Copy link
Copy Markdown
Member

Create custom, user readable error messages for scan failure instead of displaying the internal errors.

@Ruby11235 Ruby11235 self-assigned this Jul 14, 2026
@Ruby11235 Ruby11235 added 💄 UI/UX Changes related to the user interface and experience 🐛 Bug Something isn't working as intended labels Jul 14, 2026
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/fix-error-messages

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 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.

Inline comments:
In `@ecoscan_app/hooks/useAnalyzeProduct.ts`:
- Around line 88-90: Update the error handling in useAnalyzeProduct to preserve
the upstream HTTP response status on a typed error from apiClient, then classify
product-not-found responses by checking status 404 rather than matching
String(err). Keep unrelated messages from being treated as not-found, and add
tests covering a genuine 404 whose message omits the status and a non-404
message containing “404”.
- Around line 91-95: Update the catch handling in useAnalyzeProduct so
cancelAnalysis and handleStreamError cancellation/abort failures are rethrown
unchanged, preserving their user-facing behavior. Only convert unexpected
failures to the generic “Analyse fehlgeschlagen…” error, using the established
typed error codes or error types rather than matching message text.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6770f5c8-8dfc-439c-8861-4f9afba5a2b2

📥 Commits

Reviewing files that changed from the base of the PR and between 37e3d7f and a79fc48.

📒 Files selected for processing (1)
  • ecoscan_app/hooks/useAnalyzeProduct.ts

Comment thread ecoscan_app/hooks/useAnalyzeProduct.ts Outdated
Comment thread ecoscan_app/hooks/useAnalyzeProduct.ts
@Ruby11235 Ruby11235 merged commit 772e1df into main Jul 14, 2026
9 checks passed
@Ruby11235 Ruby11235 deleted the fix/fix-error-messages branch July 14, 2026 12:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

🐛 Bug Something isn't working as intended 💄 UI/UX Changes related to the user interface and experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants