Skip to content

Commit

Permalink
fix: log rejections with debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Kirkpatrick committed May 7, 2017
1 parent 43ac18b commit de7b8ae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/mixins/message-queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ module.exports = function messageQueueMixin(Model, options) {
try {
return Model[name](msg.body, msg)
.then(() => {
debug('consumer %s ran successfully for model %s. key: %o',
name, Model.modelName, msg.fields.routingKey)
debug('consumer %s ran successfully for model %s. key: %o', name, Model.modelName, msg.fields.routingKey)
return msg.ack()
})
.catch(err => {
RabbitMQ.log.error(err)
debug(`consumer ${name} failed ${Model.modelName}. key: ${msg.fields.routingKey}: %o`, err)
return msg.nack()
})
}
catch (err) {
debug(`consumer ${name} failed ${Model.modelName}. key: ${msg.fields.routingKey}: %o`, err)
RabbitMQ.log.error(err)
return msg.nack()
}
Expand Down
1 change: 0 additions & 1 deletion test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ global.sinonChai = require('sinon-chai')

global.expect = global.chai.expect

require('sinon-as-promised')
require('mocha-sinon')()

global.chai.use(require('dirty-chai'))
Expand Down
1 change: 0 additions & 1 deletion test/mixin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require('./common')

const path = require('path')
const rabbit = require('rabbot')
const requireUncached = require('./common').requireUncached

const TEST_APP = path.join(__dirname, 'fixtures/test-server/server.js')
Expand Down

0 comments on commit de7b8ae

Please sign in to comment.