feat(weather): add error card and improve error handling#774
Conversation
- Add display_errors setting to screenly.yml and screenly_qc.yml - Call setupErrorHandling() in main.ts on DOMContentLoaded - Add display_errors to e2e screenshot mock settings - Document display_errors in README.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PR Reviewer Guide 🔍(Review updated until commit 74b0611)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
There was a problem hiding this comment.
Pull request overview
Adds a display_errors setting to the Weather edge app and wires in the shared setupErrorHandling() hook so runtime failures can be surfaced via the panic-overlay mechanism (plus updates docs and screenshot-test mocks).
Changes:
- Added
display_errorstoscreenly.ymlandscreenly_qc.yml(marked as optional + advanced). - Invoked
setupErrorHandling()during app startup insrc/main.ts. - Documented
display_errorsin the app README and included it in the e2e screenshot mock settings.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| edge-apps/weather/src/main.ts | Calls shared error-handling setup on DOM ready. |
| edge-apps/weather/screenly.yml | Adds display_errors manifest setting. |
| edge-apps/weather/screenly_qc.yml | Adds display_errors manifest setting for QC. |
| edge-apps/weather/README.md | Documents the new setting in the configuration table. |
| edge-apps/weather/e2e/screenshots.spec.ts | Ensures screenshot mocks include display_errors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Persistent review updated to latest commit 576e0ff |
PR Code Suggestions ✨Explore these optional code suggestions:
|
- Use unindented list style for categories - Move schema_version after properties in display_errors help_text Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Drop try/catch so unhandled errors propagate to panic-overlay - Move signalReady() to end of happy path Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add `createErrorReporter` to toggle between panic overlay and error card based on `display_errors` setting - Add glassmorphic error card (HTML + CSS) matching the forecast card style, with landscape and portrait support - Throw on missing OpenWeatherMap API key instead of silently returning empty data - Wrap initialization in try/catch/finally with a single `signalReady()$ call - Add no-api-key screenshot tests for 3840x2160 and 2160x3840 - Update unit test to expect thrown error when API key is absent
|
Persistent review updated to latest commit 74b0611 |
PR Code Suggestions ✨Explore these optional code suggestions:
|
…onstant - Change `ErrorReporter` to accept `unknown` and rethrow the original error to preserve stack traces - Extract duplicated API key error string into `MISSING_API_KEY_ERROR` constant in `weather.ts` - Update `main.ts` and `weather.test.ts` to reference the shared constant
User description
Summary
createErrorReporterthat either throws (triggeringpanic-overlaywhendisplay_errorsis enabled) or renders a custom error card in productiontry/catch/finallywith a singlesignalReady()callPR Type
Enhancement, Bug fix, Tests, Documentation
Description
Adds configurable weather error handling
Shows missing-key error card
Tests no-key screenshots and throws
Documents
display_errorsapp settingDiagram Walkthrough
File Walkthrough
2 files
Adds no-key screenshot coverage for error cardUpdates missing API key unit expectation1 files
Adds configurable initialization error reporting1 files
Throws when forecast API key missing2 files
Styles responsive glassmorphic error screenAdds hidden weather error screen markup1 files
Documents new `display_errors` setting2 files
Adds `display_errors` manifest settingAdds QC `display_errors` manifest setting12 files