Skip to content

Commit f5bbff7

Browse files
aileenacburdine
authored andcommitted
feat(ui): add troubleshooting link to errors (#275)
refs #216 - adds message "Please refer to https://docs.ghost.org for troubleshooting." to CliError as `help` property. - adds the same message to the ui handling for native JS errors. - changes the link for supported node versions to the docs
1 parent 3c64dd5 commit f5bbff7

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

lib/commands/doctor/checks/install.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = [{
1515
`${chalk.red('The version of node you are using is not supported.')}${eol}` +
1616
`${chalk.gray('Supported: ')}${cliPackage.engines.node}${eol}` +
1717
`${chalk.gray('Installed: ')}${process.versions.node}${eol}` +
18-
`See ${chalk.underline.blue('https://support.ghost.org/supported-node-versions')} ` +
18+
`See ${chalk.underline.blue('https://docs.ghost.org/docs/supported-node-versions')} ` +
1919
'for more information'
2020
));
2121
}

lib/errors.js

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class CliError extends Error {
2424

2525
this.context = options.context || {};
2626
this.options = options;
27+
this.help = 'Please refer to https://docs.ghost.org/docs/installing-ghost-via-the-cli#troubleshooting for troubleshooting.'
2728
}
2829

2930
/**

lib/ui/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ class UI {
294294
let logLocation = system.writeErrorLog(stripAnsi(`${debugInfo}\n${verboseOutput}`));
295295
this.log(`\nAdditional log info available in: ${logLocation}`);
296296
}
297+
298+
this.log('\n' + error.help, 'blue');
297299
} else if (error instanceof Error) {
298300
// System errors or regular old errors go here.
299301
let output = `An error occurred.\n${chalk.yellow('Message:')} '${error.message}'\n\n`;
@@ -321,6 +323,7 @@ class UI {
321323
this.log(debugInfo, 'yellow');
322324
let logLocation = system.writeErrorLog(stripAnsi(`${debugInfo}\n${output}`));
323325
this.log(`\nAdditional log info available in: ${logLocation}`);
326+
this.log('\nPlease refer to https://docs.ghost.org/docs/installing-ghost-via-the-cli#troubleshooting for troubleshooting.', 'blue');
324327
} else if (isObject(error)) {
325328
// TODO: find better way to handle object errors?
326329
this.log(JSON.stringify(error), null, true);

0 commit comments

Comments
 (0)