No console.error in production without boundary
Why it matters
A catch block that contains only console.error() and no further action is functionally equivalent to swallowing the error in production. CWE-778 (Insufficient Logging) applies when logging goes only to a console that no one monitors in real time. CWE-391 (Unchecked Error Condition) applies when the error is recorded but not acted upon — no user feedback, no monitoring service capture. ISO 25010 reliability.fault-tolerance requires that error conditions trigger corrective action, not just log output. Most hosted Node.js environments (Vercel, Railway, Fly.io) don't surface raw console.error output to developers in real time, making bare-console error handling invisible in practice.
Severity rationale
Low because `console.error`-only catch blocks produce a log record but no user feedback and no monitoring alert, making errors practically invisible in production hosting environments.
Remediation
Replace bare console.error catch blocks with handling that notifies both the user and the monitoring service.
// Before — error disappears in production
} catch (error) {
console.error('Failed to fetch user:', error)
}
// After — error is visible to monitoring and the user
} catch (error) {
console.error('Failed to fetch user:', error) // keep for local dev context
Sentry.captureException(error, { extra: { context: 'fetchUser' } })
setError('Unable to load your profile. Please refresh.')
}
Search the codebase for console.error inside catch blocks using your IDE's symbol search and audit each one: if there is no captureException call and no state update in the same block, it needs both additions.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Error Handling Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-778 — Insufficient Logging
- cwe · CWE-391 — Unchecked Error Condition
- iso-25010:2011 · reliability.fault-tolerance
Taxons
History
- 2026-04-18·v1.0.0·Initial import from saas-error-handling·automated