Commit 722cbe26ce4fde5590323faa3abb3fc2b1db248a
Merge branch 'error-handling'
Dominic Tarr committed on 7/25/2016, 5:16:52 AMParent: 85234427043c9af0029e4c1e29b958c46b9b09a3
Parent: 3c5dd43a2f6adbcaaad339b0a31e11f7d87eec1f
Files changed
index.js | changed |
modules/message-confirm.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') |
modules/message-confirm.js | ||
---|---|---|
@@ -15,9 +15,10 @@ | ||
15 | 15 | var lb = lightbox() |
16 | 16 | document.body.appendChild(lb) |
17 | 17 | |
18 | 18 | var okay = h('button', 'okay', {onclick: function () { |
19 | - publish(content); lb.remove(); cb(null, content) | |
19 | + lb.remove() | |
20 | + publish(content, cb) | |
20 | 21 | }}) |
21 | 22 | |
22 | 23 | var cancel = h('button', 'cancel', {onclick: function () { |
23 | 24 | lb.remove() |
Built with git-ssb-web