git ssb

0+

ev / microbay



forked from Dominic / patchbay

Commit cc5e838dce2fc6b64f1607e8a71f33b4676fc604

Remove fallback error handler when tabs are ready

Charles Lehner committed on 9/9/2016, 7:36:56 PM
Parent: cebcd567601116ec38e6c09a6add1521f9a56f53

Files changed

index.jschanged
modules/tabs.jschanged
index.jsView
@@ -1,7 +1,7 @@
11 var h = require('hyperscript')
22
3-window.addEventListener('error', function onError(e) {
3+window.addEventListener('error', window.onError = function (e) {
44 document.body.appendChild(h('div.error',
55 h('h1', e.message),
66 h('big', h('code', e.filename + ':' + e.lineno)),
77 h('pre', e.error ? (e.error.stack || e.error.toString()) : e.toString())))
modules/tabs.jsView
@@ -160,8 +160,15 @@
160160 errorsContent
161161 )
162162 )
163163
164+ // remove loader error handler
165+ if (window.onError) {
166+ window.removeEventListener('error', window.onError)
167+ delete window.onError
168+ }
169+
170+ // put errors in a tab
164171 window.addEventListener('error', function (ev) {
165172 var err = ev.error || ev
166173 if(!tabs.has('errors'))
167174 tabs.add('errors', errors, false)

Built with git-ssb-web