Skip to content

Commit

Permalink
Fix for error name.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto Ricart committed Dec 4, 2016
1 parent 12d55db commit 00e09ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/nats.js
Expand Up @@ -97,7 +97,7 @@ var VERSION = '0.7.0',
FLUSH_THRESHOLD = 65536;


var NatsError = function(message, code, chainedError) {
function NatsError(message, code, chainedError) {
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
Expand Down
1 change: 1 addition & 0 deletions test/errors.js
Expand Up @@ -89,6 +89,7 @@ describe('Errors', function() {
should.equal(err.message, 'hello');
should.equal(err.code, 'helloid');
should.equal(err.chainedError, srcErr);
should.equal(err.name, 'NatsError');
});

});

0 comments on commit 00e09ab

Please sign in to comment.