-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Catch cron errors #5707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catch cron errors #5707
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds error handling for invalid cron expressions in the schedule modal and improves error display formatting throughout the app.
Key Changes
- Adds validation state to disable form submission when cron expressions are invalid
- Catches and displays errors from the cronstrue library when parsing cron expressions
- Refactors error rendering to use a consistent
errorMessageutility function
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ui/desktop/src/components/schedule/ScheduleModal.tsx | Adds isValid state and disables submit button when cron expression is invalid |
| ui/desktop/src/components/schedule/CronPicker.tsx | Implements error handling for cron parsing with try-catch and validation callback |
| ui/desktop/src/components/ErrorBoundary.tsx | Refactors to use string errors and errorMessage utility for consistent formatting |
| ui/desktop/src/App.tsx | Updates fatal error handling to use errorMessage utility |
| try { | ||
| const cron = cronstrue.toString(cronWithoutSeconds); | ||
| isValid(true); | ||
| return cron; | ||
| } catch (e) { | ||
| isValid(false); | ||
| return 'error: ' + errorMessage(e); | ||
| } |
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling isValid() during render (inside getReadable()) violates React best practices - state updates should not occur during render. Move the validation logic to a useEffect that depends on currentCron, and have getReadable() only return the display string without side effects.
…xt-test * 'main' of github.com:block/goose: chore: Add Adrian Cole to Maintainers (#5815) [MCP-UI] Proxy and Better Message Handling (#5487) Release 1.15.0 Document New Window menu in macOS dock (#5811) Catch cron errors (#5707) feat/fix Re-enabled WAL with commit transaction management (Linux Verification Requested) (#5793) chore: remove autopilot experimental feature (#5781) Read paths from an interactive & login shell (#5774) docs: acp clients (#5800)
* main: (33 commits) fix: support Gemini 3's thought signatures (#5806) chore: Add Adrian Cole to Maintainers (#5815) [MCP-UI] Proxy and Better Message Handling (#5487) Release 1.15.0 Document New Window menu in macOS dock (#5811) Catch cron errors (#5707) feat/fix Re-enabled WAL with commit transaction management (Linux Verification Requested) (#5793) chore: remove autopilot experimental feature (#5781) Read paths from an interactive & login shell (#5774) docs: acp clients (#5800) Provider error proxy for simulating various types of errors (#5091) chore: Add links to maintainer profiles (#5788) Quick fix for community all stars script (#5798) Document Mistral AI provider (#5799) docs: Add Community Stars recipe script and txt file (#5776) chore: incorporate LF feedback (#5787) docs: quick launcher (#5779) Bump auto scroll threshold (#5738) fix: add one-time cleanup for linux hermit locking issues (#5742) Don't show update tray icon if GOOSE_VERSION is set (#5750) ...
Co-authored-by: Douwe Osinga <[email protected]> Signed-off-by: Blair Allan <[email protected]>
Summary
Show cron errors and disable submission for invalid values. also in the process noticed that any errors that bubble up sometimes just get rendered the wrong way