1 | var ansi = require('ansi-escape-sequences')
|
2 | var dedent = require('dedent')
|
3 |
|
4 | function clr (text, color) {
|
5 | return process.stdout.isTTY ? ansi.format(text, color) : text
|
6 | }
|
7 |
|
8 | module.exports = function fatalError (err) {
|
9 | return dedent`
|
10 | A critical error occured, forcing Bankai to abort:
|
11 | ${clr(err.stack, 'red')}
|
12 |
|
13 | If you think this might be a bug in Bankai, please consider helping
|
14 | improve Bankai's stability by submitting an error to:
|
15 |
|
16 | ${clr('https://github.com/choojs/bankai/issues/new', 'underline')}
|
17 |
|
18 | Please include the steps to reproduce this error, the stack trace
|
19 | printed above, your version of Node, and your version of npm. Thanks!
|
20 | ${clr('— Team Choo', 'italic')}
|
21 |
|
22 | `
|
23 | }
|