Files: 03511a5a91763463c215e71fcb1df1b39e97b43f / 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