Skip to content

Commit

Permalink
Add uncaught error handlers in renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsage committed Aug 20, 2024
1 parent c21e69e commit af2b38e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions renderer/renderJS/util/util_lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,18 @@ function enhanceI18N() {
})
}

// MARK: ERROR HANDLE
window.addEventListener('unhandledrejection', (e) => {
window.log.error('Unhandled Rejection')
window.log.warning(e?.reason?.message)
window.log.warning(e?.reason?.stack)
})
window.addEventListener('error', (e) => {
window.log.error('Uncaught Error')
window.log.warning(e?.error?.message)
window.log.warning(e?.error?.stack)
})

// MARK: PAGE LOAD
window.addEventListener('DOMContentLoaded', () => {
enhanceI18N()
Expand Down

0 comments on commit af2b38e

Please sign in to comment.