Files: 2d581d5e26ada49ca088f855fb0c84c4a6f129c6 / modules_core / error.js
381 bytesRaw
1 | const fs = require('fs') |
2 | const h = require('../h') |
3 | |
4 | exports.gives = { |
5 | build_error: true, |
6 | mcss: true |
7 | } |
8 | |
9 | exports.create = function (api) { |
10 | return { |
11 | build_error, |
12 | mcss: () => fs.readFileSync(__filename.replace(/js$/, 'mcss'), 'utf8') |
13 | } |
14 | |
15 | function build_error (err) { |
16 | return h('Error', [ |
17 | h('header', err.message), |
18 | h('pre', err.stack) |
19 | ]) |
20 | } |
21 | |
22 | } |
23 | |
24 |
Built with git-ssb-web