🐛 GhostError needs to inherit from Error (#7582)

no issue
This commit is contained in:
Katharina Irrgang 2016-10-19 16:27:22 +02:00 committed by Hannah Wolfe
parent 441f7e54e8
commit 8bcd000829
2 changed files with 6 additions and 0 deletions

View File

@ -166,6 +166,7 @@ var errors = {
}
};
util.inherits(GhostError, Error);
_.each(errors, function (error) {
util.inherits(error, GhostError);
});

View File

@ -4,6 +4,11 @@ var errors = require('../../server/errors'),
should.equal(true, true);
describe('Errors', function () {
it('Ensure we inherit from Error', function () {
var ghostError = new errors.GhostError();
(ghostError instanceof Error).should.eql(true);
});
describe('Inherite from other error', function () {
it('default', function () {
var someError = new Error(), ghostError;