constructor(options) {
        const originalError = {};

        options = options || {};

        if (typeof options === 'string') {
            options = {message: options};
        }

        super(options.message || 'An error occurred.');

        // more accurate stack trace - removes the 'new Error' call
        // see https://nodejs.org/api/errors.html#errors_error_capturestacktrace_targetobject_constructoropt
        Error.captureStackTrace(this, this.constructor);

        this.options = options;
        this.logMessageOnly = options.logMessageOnly;

        this.help = 'You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.';

        if (options.err) {
            if (typeof options.err === 'string') {
                options.err = new Error(options.err);
            }

            Object.getOwnPropertyNames(options.err).forEach((property) => {
                if (['response', 'headers'].indexOf(property) !== -1) {
                    return;
                }

                // TODO: we receive all possible properties now, except the excluded ones above
                // Currently we're logging only the message and the stack property.
                // This part of the code could probably be simplyfied if we won't need other
                // properties in the future
                originalError[property] = options.err[property];
            });
        }

        this.err = originalError;
    }
Base CLI Error class. Extends error and augments it
with some cli-specific functionality

@class CliError
@extends Error