Summary
Unhandled JavaScript errors that occur outside of React's render cycle (e.g. in event handlers, async callbacks, or third-party scripts) are never captured in structured logs. A window.onerror handler should capture these and emit a structured log before they disappear silently.
Scope
- Register a
window.onerror handler on app initialisation
- Emit a debug-level structured log on each unhandled error with fields:
message, source, line, col, error_type
- Handler should not suppress the default browser error behaviour (return false)
- Handler should be registered once and not re-registered on re-renders
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
Unhandled JavaScript errors that occur outside of React's render cycle (e.g. in event handlers, async callbacks, or third-party scripts) are never captured in structured logs. A
window.onerrorhandler should capture these and emit a structured log before they disappear silently.Scope
window.onerrorhandler on app initialisationmessage,source,line,col,error_typeAcceptance Criteria
ETA: 12 hours
Coordinate on Telegram