Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const AmqpChannel = require('amqplib/lib/callback_model').Channel;
const monad = require('./iomonad.js');
const log = require('../log')('rabbot.channel');
/* log
* `rabbot.channel`
* `debug`
* when amqplib's `channel.close` promise is rejected
*/
function close (name, channel) {
if (channel.close) {
return channel.close()
.then(null, function (err) {
// since calling close on channel could reject the promise
// (see connection close's comment) this catches and logs it
// for debug level