Repository navigation
Fix: eliminate silently swallowed errors via .catch(() => {}) - #744
Conversation
Replace all 6 instances of .catch(() => {}) with proper error logging
using console.error, ensuring errors are visible in logs for debugging.
Affected files:
- src/app/api/automation/sync/route.ts (lock release)
- src/app/api/sync/route.ts (lock release)
- src/app/api/sync/scheduled/route.ts (sync run update + lock release)
- src/lib/automation-sync.ts (automation repo error state update)
- src/app/automation/page.tsx (PR fix queue fetch)
- src/app/login/page.tsx (session check)
Fixes #0
Signed-off-by: Saffron <263493777+itsmiso-ai@users.noreply.github.com>
There was a problem hiding this comment.
AI Automated Review
Full PR review.
Analysis engine: MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic) — routed smart (risk match: public_route_changes)
Review
Recommendation: Approve.
This PR replaces .catch(() => {}) (which silently swallows errors) with .catch((error) => { console.error(...) }) across 6 files. The changes are consistent, targeted, and improve observability without altering behavior or access patterns.
Change-by-Change Findings
| File | Change | Assessment |
|---|---|---|
src/app/api/automation/sync/route.ts |
Added error logging for lock release failure in finally block |
✅ Safe improvement |
src/app/api/sync/route.ts |
Added error logging for lock release failure in finally block |
✅ Safe improvement |
src/app/api/sync/scheduled/route.ts |
Added error logging for 2 catch blocks (sync run error state + lock release) | ✅ Safe improvement |
src/app/automation/page.tsx |
Added error logging for PR fix queue fetch failure | ✅ Safe improvement |
src/app/login/page.tsx |
Added error logging for session check failure | ✅ Safe improvement |
src/lib/automation-sync.ts |
Added error logging for automation repo error state update | ✅ Safe improvement |
Must-Check Items
✅ verify route access controls are in place
This PR does not modify authentication or authorization logic. The affected API routes (/api/automation/sync, /api/sync, /api/sync/scheduled) retain whatever access controls they had before. No new routes are exposed. The frontend pages (/automation, /login) are standard UI routes and unchanged in terms of access.
✅ check for unintended public endpoints
No new endpoints are introduced. The changes are limited to error handling within existing handlers. No route paths, HTTP methods, or middleware were altered.
Standards Compliance
- Error handling: The AGENTS.md convention requires "provide meaningful error messages" via
error instanceof Errorpattern. The PR usesconsole.errorwith descriptive messages and includes the error object, which aligns with improved observability. The existingconsole.errorpatterns in the codebase (e.g., insrc/app/api/sync/route.tsline 72) confirm this is the project's convention for logging at the route level. - No auth changes: No authentication logic was modified.
- CI: All checks passed (lint, typecheck, build, tests, docker, npm audit).
Tool Harness Findings
No tool calls were issued; reviewing the corpus directly.
Unknowns / Needs Verification
None — the diff is self-contained, CI passed, and the changes are trivially verifiable.
Summary
Refs #681
Provenance
The coder finished this successfully (verdict GO) on
foreman/wl-misospace-dispatch-0/issue-0, commit167065904. The review never ran: foreman's litellm key was not scoped to therevieweralias, so every review request was rejected and the task ended INCOMPLETE, and no PR was opened.That branch name is derived from issue number
0, which is a bug — it is shared by every third-attempt retry in this repo, so the commit was one retry away from being force-pushed over. Cherry-picked onto a non-foreman/*branch to preserve it.Not using a closing keyword: foreman may still redo this issue, and it owns the issue lifecycle.
Verification
main; no conflicts.