lib/exchange.js
function createExchangeErrorHandlerFor (exchange) {
  return function (err) {
    if (!exchange.options.confirm) return;

    // should requeue instead?
    // https://www.rabbitmq.com/reliability.html#producer
    debug && debug('Exchange error handler triggered, erroring and wiping all unacked publishes');
    for (var id in exchange._unAcked) {
      var task = exchange._unAcked[id];
      task.emit('ack error', err);
      delete exchange._unAcked[id];
    }
  };
}
function createExchangeErrorHandlerFor (exchange) {
  return function (err) {
    if (!exchange.options.confirm) return;

    // should requeue instead?
    // https://www.rabbitmq.com/reliability.html#producer
    debug && debug('Exchange error handler triggered, erroring and wiping all unacked publishes');
    for (var id in exchange._unAcked) {
      var task = exchange._unAcked[id];
      task.emit('ack error', err);
      delete exchange._unAcked[id];
    }
  };
}
function createExchangeErrorHandlerFor ( exchange ) { return function ( err ) { if ( ! exchange . options . confirm ) return ; // should requeue instead? // https://www.rabbitmq.com/reliability.html#producer debug && debug ( 'Exchange error handler triggered, erroring and wiping all unacked publishes' ) ; for ( var id in exchange . _unAcked ) { var task = exchange . _unAcked [ id ] ; task . emit ( 'ack error' , err ) ; delete exchange . _unAcked [ id ] ; } } ; }
creates an error handler scoped to the given `exchange`
creates an error handler scoped to the given exchange