Skip to content

Commit

Permalink
also log messages if the item does not have an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
rokob committed Jun 15, 2017
1 parent d7c14e5 commit 989ea5a
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,20 @@ Queue.prototype._dequeuePendingRequest = function(item) {
};

Queue.prototype._maybeLog = function(item) {
if (this.logger && this.options.verbose) {
var message = _.get(item, 'data.body.trace.exception.message');
if (!message) {
message = _.get(item, 'data.body.trace_chain.0.exception.message');
}
if (message) {
this.logger.error(message);
}
if (!this.logger || !this.options.verbose) {
return;
}

var message = _.get(item, 'data.body.trace.exception.message');
message = message || _.get(item, 'data.body.trace_chain.0.exception.message');
if (message) {
this.logger.error(message);
return;
}

message = _.get(item, 'data.body.message.body');
if (messagge) {
this.logger.log(message);
}
};

Expand Down

0 comments on commit 989ea5a

Please sign in to comment.