Commit 3c5dd43a2f6adbcaaad339b0a31e11f7d87eec1f
Add fallback error handler
Charles Lehner committed on 7/24/2016, 2:27:52 PMParent: 80053725d6e9728e8a7002217581df77265f422d
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -1,5 +1,13 @@ | ||
1 | 1 | var h = require('hyperscript') |
2 | + | |
3 | +window.addEventListener('error', function onError(e) { | |
4 | + document.body.appendChild(h('div.error', | |
5 | + h('h1', e.message), | |
6 | + h('big', h('code', e.filename + ':' + e.lineno)), | |
7 | + h('pre', e.error ? (e.error.stack || e.error.toString()) : e.toString()))) | |
8 | +}) | |
9 | + | |
2 | 10 | var u = require('./util') |
3 | 11 | var pull = require('pull-stream') |
4 | 12 | var combine = require('depject') |
5 | 13 | var fs = require('fs') |
Built with git-ssb-web