Skip to content

Commit

Permalink
Remove adding error tag. Closes hapijs#1231
Browse files Browse the repository at this point in the history
  • Loading branch information
Eran Hammer committed Dec 20, 2013
1 parent 2033802 commit 6f860d5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/ext.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ internals.Ext.runProtected = function (logger, tags, next, setup) { // se
var onError = function (err) {

if (logger) {
logger.log(['hapi', 'uncaught'].concat(tags || []), err); // 'uncaught' treated special in request.log
logger.log(['hapi', 'uncaught', 'error'].concat(tags || []), err); // 'uncaught' treated special in request.log
}

return finish(Boom.badImplementation('Uncaught error', err));
Expand Down
2 changes: 0 additions & 2 deletions lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,6 @@ internals.Request.prototype.log = function (tags, data, timestamp) {

if (data) {
if (data instanceof Error) {
item.tags = tags.concat('error');
tagsMap.error = true;
item.data = (data.isBoom ? data.decorations() : {});
item.data.message = data.message;
if (tagsMap.uncaught) {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ describe('Request', function () {

if (prints === 1) {
expect(arguments[0]).to.equal('Debug:');
expect(arguments[1]).to.equal('hapi, uncaught, handler, error');
expect(arguments[1]).to.equal('hapi, uncaught, error, handler');
}
else {
console.error = orig;
Expand Down

0 comments on commit 6f860d5

Please sign in to comment.