error(error, system) {
        const debugInfo = this._formatDebug(system);

        if (error instanceof errors.CliError) {
            if (error.logMessageOnly) {
                return this.fail(error.message);
            }

            // Error is one that is generated by CLI usage (as in, the CLI itself
            // manually generates this error)
            this.log(`A ${error.type} occurred.\n`, 'red');

            // We always want to output the verbose error to the logfile, so we go ahead and get it now
            const verboseOutput = error.toString(true);

            // Log the verbose error if verbose is set, otherwise log the non-verbose error output
            this.log(this.verbose ? verboseOutput : error.toString(false), null, true);
            this.log(debugInfo, 'yellow');

            if (error.logToFile()) {
                const logLocation = system.writeErrorLog(stripAnsi(`${debugInfo}\n${verboseOutput}`));
                this.log(`\nAdditional log info available in: ${logLocation}`);
            }

            this.log(`\nTry running ${(chalk.cyan('ghost doctor'))} to check your system for known issues.`);

            this.log('\n' + error.help, 'blue');
        } else if (error instanceof ListrError) {
            // Listr errors have an array of errors appended to them
            this.log('One or more errors occurred.', 'red');

            const logOutput = [];

            error.errors.forEach((err, index) => {
                const verboseOutput = err.toString(true);

                this.log(`\n${index + 1}) ${err.options && err.options.task ? err.options.task : err.type}\n`, 'red', true);
                this.log(this.verbose ? verboseOutput : err.toString(false), null, true);

                if (err.logToFile && err.logToFile()) {
                    logOutput.push(stripAnsi(verboseOutput));
                }
            });

            this.log(debugInfo, 'yellow');

            if (logOutput.length) {
                const logLocation = system.writeErrorLog(stripAnsi(`${debugInfo}\n${logOutput.join('\n\n')}`));
                this.log(`\nAdditional log info available in: ${logLocation}`);
            }

            this.log(`\nTry running ${(chalk.cyan('ghost doctor'))} to check your system for known issues.`);
            this.log('\nYou can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.', 'blue');
        } else if (error instanceof Error) {
            // System errors or regular old errors go here.
            let output = `An error occurred.\n${chalk.yellow('Message:')} '${error.message}'\n\n`;

            if (!this.verbose) {
                this.log(output, 'red', true);
            }

            if (error.stack) {
                output += `${chalk.yellow('Stack:')} ${error.stack}\n`;
            }

            if (error.code) {
                output += `${chalk.yellow('Code:')} ${error.code}\n`;
            }

            if (error.path) {
                output += `${chalk.yellow('Path:')} ${error.path}\n`;
            }

            if (this.verbose) {
                this.log(output, 'red', true);
            }

            this.log(debugInfo, 'yellow');
            const logLocation = system.writeErrorLog(stripAnsi(`${debugInfo}\n${output}`));
            this.log(`\nAdditional log info available in: ${logLocation}`);
            this.log(`\nTry running ${(chalk.cyan('ghost doctor'))} to check your system for known issues.`);
            this.log('\nYou can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.', 'blue');
        } else if (isObject(error)) {
            // TODO: find better way to handle object errors?
            this.log(JSON.stringify(error), null, true);
            this.log(`\nTry running ${(chalk.cyan('ghost doctor'))} to check your system for known issues.`);
        } else if (error !== false) {
            // If the error is false, we're just exiting (makes the promise chains easier)
            this.log('An unknown error occured.', null, true);
            this.log(`\nTry running ${(chalk.cyan('ghost doctor'))} to check your system for known issues.`);
        }
    }
Error handler for the CLI. Takes a given error and outputs a formated and more human-readable
error to the specified out stream.

@param {Error|Object} error Error to handle
@param {System} system object

@method error
@public