Skip to content

fix(ui): improve error message specificity in NewsPanel and PWA registration#833

Open
NewCoder3294 wants to merge 1 commit intokoala73:mainfrom
NewCoder3294:fix/error-message-specificity
Open

fix(ui): improve error message specificity in NewsPanel and PWA registration#833
NewCoder3294 wants to merge 1 commit intokoala73:mainfrom
NewCoder3294:fix/error-message-specificity

Conversation

@NewCoder3294
Copy link
Contributor

Summary

  • NewsPanel.ts: Replaced generic "Could not generate summary" and "Summary failed" with contextual messages that include the error category (e.g. "Summary failed (timeout)", "Summary unavailable (no providers responded)")
  • InsightsPanel.ts: Replaced generic "Analysis failed - retrying..." with categorized error reason (e.g. "Analysis failed (network error) - retrying...")
  • main.ts: Replaced silent .catch(() => {}) on service worker registration and the hourly update interval with console.warn logging that includes the error object, aiding offline-mode debugging
  • Added classifyError() static helper to both NewsPanel and InsightsPanel that maps common error types (timeout, network, rate limit, auth, server error) to concise user-facing labels without exposing internal details

Details

Error classification categories:

Error type User-facing label
AbortError DOMException request cancelled
TypeError with fetch/network network error
Message contains "timeout" timeout
Message contains "429" / "rate" / "quota" rate limited
Message contains "401" / "403" / "unauthorized" auth error
Message contains 5xx pattern server error
Anything else unexpected error

All developer-facing console.warn calls include the full error object for debugging.

Test plan

  • Trigger summary generation with API providers down — verify message shows "Summary unavailable (no providers responded)" instead of "Could not generate summary"
  • Simulate a network error during summary — verify message shows "Summary failed (network error)"
  • Verify InsightsPanel shows categorized error on analysis failure
  • Disable service worker (e.g. serve without HTTPS) — verify console shows [PWA] Service worker registration failed: with error details
  • Verify no regressions in happy-path summarization flow

🤖 Generated with Claude Code

…tration

- NewsPanel: replace generic "Could not generate summary" / "Summary failed"
  with contextual messages like "Summary failed (timeout)" or
  "Summary unavailable (no providers responded)"
- InsightsPanel: replace generic "Analysis failed" with categorized reason
  (timeout, network error, rate limited, etc.)
- main.ts: replace silent .catch(() => {}) on service worker registration and
  update with console.warn logging for easier offline-mode debugging
- Add classifyError() helper to NewsPanel and InsightsPanel that categorizes
  errors into user-friendly labels without exposing internal details

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 2, 2026

@NewCoder3294 is attempting to deploy a commit to the Elie Team on Vercel.

A member of the Team first needs to authorize it.

@koala73 koala73 added Not Ready to Merge PR has conflicts, failing checks, or needs work Low Value Trivial, unnecessary, or not aligned with project needs labels Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Low Value Trivial, unnecessary, or not aligned with project needs Not Ready to Merge PR has conflicts, failing checks, or needs work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants