git ssb

16+

Dominic / patchbay



Tree: bc574122903c7ef4a0abf0fb4918a12a4e96a977

Files: bc574122903c7ef4a0abf0fb4918a12a4e96a977 / app / page / errors.js

711 bytesRaw
1const nest = require('depnest')
2const { h } = require('mutant')
3
4exports.gives = nest('app.page.errors')
5
6exports.needs = nest({
7 'app.html.scroller': 'first'
8})
9
10exports.create = function (api) {
11 return nest('app.page.errors', errorsPage)
12
13 function errorsPage (location) {
14 var { container, content } = api.app.html.scroller({ className: 'Errors', title: '/errors' })
15
16 container.id = JSON.stringify(location)
17 // note this page needs an id assigned as it's not added by addPage
18
19 function addError (err) {
20 const error = h('Error', [
21 h('header', err.message),
22 h('pre', err.stack)
23 ])
24
25 content.appendChild(error)
26 }
27
28 return { container, addError }
29 }
30}
31

Built with git-ssb-web