Improve error logging (#707)

e.g. undefined <video> errors
This commit is contained in:
Mathias Rasmussen
2016-07-14 23:01:58 +02:00
committed by DC
parent c15711aae8
commit be1314422d
2 changed files with 5 additions and 5 deletions

View File

@@ -123,12 +123,12 @@ function logUncaughtError (procName, err) {
if (!telemetry) return
var message, stack
if (typeof err === 'string') {
message = err
stack = ''
} else {
if (err instanceof Error) {
message = err.message
stack = err.stack
} else {
message = String(err)
stack = ''
}
// We need to POST the telemetry object, make sure it stays < 100kb

View File

@@ -109,7 +109,7 @@ function onState (err, _state) {
// Log uncaught JS errors
window.addEventListener('error',
(e) => telemetry.logUncaughtError('window', e.error), true)
(e) => telemetry.logUncaughtError('window', e.error || e.target), true)
// Done! Ideally we want to get here < 500ms after the user clicks the app
sound.play('STARTUP')