Skip to content

Commit

Permalink
🐛 GhostError needs to inherit from Error (#7582)
Browse files Browse the repository at this point in the history
no issue
  • Loading branch information
kirrg001 authored and ErisDS committed Oct 19, 2016
1 parent 441f7e5 commit 8bcd000
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/server/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ var errors = {
}
};

util.inherits(GhostError, Error);
_.each(errors, function (error) {
util.inherits(error, GhostError);
});
Expand Down
5 changes: 5 additions & 0 deletions core/test/unit/errors_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8bcd000

Please sign in to comment.