How to use the ghost-ignition.errors.IgnitionError function in ghost-ignition

To help you get started, we’ve selected a few ghost-ignition examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TryGhost / Ghost / core / server / lib / common / errors.js View on Github external
},
    UpdateCollisionError: function UpdateCollisionError(options) {
        GhostError.call(this, merge({
            statusCode: 409,
            errorType: 'UpdateCollisionError'
        }, options));
    },
    HelperWarning: function HelperWarning(options) {
        GhostError.call(this, merge({
            errorType: 'HelperWarning',
            hideStack: true
        }, options));
    }
};

util.inherits(GhostError, errors.IgnitionError);
each(ghostErrors, function (error) {
    util.inherits(error, GhostError);
});

// we need to inherit all general errors from GhostError, otherwise we have to check instanceof IgnitionError
each(errors, function (error) {
    if (error.name === 'IgnitionError' || typeof error === 'object') {
        return;
    }

    util.inherits(error, GhostError);
});

module.exports = merge(ghostErrors, errors);
module.exports.GhostError = GhostError;
github chadly / ghost / core / server / errors.js View on Github external
},
    DisabledFeatureError: function DisabledFeatureError(options) {
        GhostError.call(this, _.merge({
            statusCode: 409,
            errorType: 'DisabledFeatureError',
        }, options));
    },
    UpdateCollisionError: function UpdateCollisionError(options) {
        GhostError.call(this, _.merge({
            statusCode: 409,
            errorType: 'UpdateCollisionError',
        }, options));
    }
};

util.inherits(GhostError, errors.IgnitionError);
_.each(ghostErrors, function (error) {
    util.inherits(error, GhostError);
});

// we need to inherit all general errors from GhostError, otherwise we have to check instanceof IgnitionError
_.each(errors, function (error) {
    if (error.name === 'IgnitionError' || typeof error === 'object') {
        return;
    }

    util.inherits(error, GhostError);
});

module.exports = _.merge(ghostErrors, errors);
module.exports.GhostError = GhostError;
github chadly / ghost / core / server / errors.js View on Github external
function GhostError(options) {
    options = options || {};
    this.value = options.value;

    errors.IgnitionError.call(this, options);
}
github TryGhost / Ghost / core / server / lib / common / errors.js View on Github external
function GhostError(options) {
    options = options || {};
    this.value = options.value;

    errors.IgnitionError.call(this, options);
}
github TryGhost / bookshelf-relations / errors.js View on Github external
function BookshelfRelationsError(options) {
    options = options || {};

    options.errorType = 'BookshelfRelationsError';
    options.level = 'critical';

    errors.IgnitionError.call(this, options);
}
github TryGhost / bookshelf-relations / errors.js View on Github external
const errors = require('ghost-ignition').errors,
    util = require('util');

function BookshelfRelationsError(options) {
    options = options || {};

    options.errorType = 'BookshelfRelationsError';
    options.level = 'critical';

    errors.IgnitionError.call(this, options);
}

util.inherits(BookshelfRelationsError, errors.IgnitionError);

module.exports = errors;
module.exports.BookshelfRelationsError = BookshelfRelationsError;