Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions lib/baseClasses/HttpError.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,5 @@ HttpError.prototype.toJSON = function toJSON() {
return JSON.stringify(self.body);
};

/**
* implement toString()
* @public
* @method toString
* @returns {String}
*/
HttpError.prototype.toString = function toString() {
var self = this;
return self.name + ': ' + self.body.message;
};


module.exports = HttpError;
8 changes: 0 additions & 8 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ describe('restify-errors node module.', function() {
code: 'Error',
message: ''
}));
assert.equal(myErr.toString(), 'HttpError: ');
});

it('should create HttpError using options object', function() {
Expand Down Expand Up @@ -117,7 +116,6 @@ describe('restify-errors node module.', function() {
code: 'BadGateway',
message: ''
}));
assert.equal(myErr.toString(), 'BadGatewayError: ');
});

it('should create BadGatewayError using options object', function() {
Expand Down Expand Up @@ -190,7 +188,6 @@ describe('restify-errors node module.', function() {
code: 'Error',
message: ''
}));
assert.equal(myErr.toString(), 'RestError: ');
});

it('should create RestError, using options object', function() {
Expand Down Expand Up @@ -270,7 +267,6 @@ describe('restify-errors node module.', function() {
code: 'BadDigest',
message: ''
}));
assert.equal(myErr.toString(), 'BadDigestError: ');
});

it('should create BadDigestError, using options object', function() {
Expand Down Expand Up @@ -560,7 +556,6 @@ describe('restify-errors node module.', function() {
code: 'Execution',
message: 'bad joystick input'
}));
assert.equal(err.toString(), 'ExecutionError: bad joystick input');
});

it('should create custom error instance using options', function() {
Expand Down Expand Up @@ -597,7 +592,6 @@ describe('restify-errors node module.', function() {
code: 'Execution',
message: 'bad joystick input'
}));
assert.equal(err.toString(), 'ExecutionError: bad joystick input');
});

it('should create custom error using makeConstructor (with lower case Error name)', function() {
Expand All @@ -616,7 +610,6 @@ describe('restify-errors node module.', function() {
code: 'Execution',
message: 'bad joystick input'
}));
assert.equal(err.toString(), 'Executionerror: bad joystick input');
});

it('should throw when creating a constructor that already exists', function() {
Expand Down Expand Up @@ -647,7 +640,6 @@ describe('restify-errors node module.', function() {
code: 'NotAcceptable',
message: 'the horror'
}));
assert.equal(err.toString(), 'NotAcceptableError: the horror');
});
});

Expand Down