mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Redirect window.onerror to uncaughtException.
This commit is contained in:
@@ -37,3 +37,11 @@ if window.location.protocol is 'file:'
|
||||
else
|
||||
global.__filename = __filename
|
||||
global.__dirname = __dirname
|
||||
|
||||
# Redirect window.onerror to uncaughtException.
|
||||
window.onerror = (error) ->
|
||||
if global.process.listeners('uncaughtException').length > 0
|
||||
global.process.emit 'uncaughtException', error
|
||||
true
|
||||
else
|
||||
false
|
||||
|
||||
Reference in New Issue
Block a user