title: handling pika.exceptions.BodyTooLongError
body: <p>My RabbitMQ listener has started raising pika.exceptions.BodyTooLongError exceptions. I have never seen them before.  </p>
  
  <p>Google reveals very little about this error and its causes. </p>
  
  <p>The traceback error message I get is:</p>
  
  <pre><code>'NoneType' object has no attribute 'body_size'
  Traceback (most recent call last):
    File "./foo.py", line 585, in &lt;module&gt;
      channel.start_consuming()
    File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 1681, in start_consuming
      self.connection.process_data_events(time_limit=None)
  ...
    File "/usr/local/lib/python2.7/dist-packages/pika/channel.py", line 1246, in _handle_body_frame
      self._header_frame.body_size)
    pika.exceptions.BodyTooLongError: (180, 90)
  </code></pre>
  
  <p>I am a bit puzzled by this.  NoneType has no attribute -error sounds a bit like a bug to me, while "Body too long" indicates some kind of a resource exhaustion situation, which should not be a problem. </p>
  
  <p>What should I do with this? Better quit and restart the program? Ignore the error and assume some data is lost? The program in question is a receiver that subscribes to certain routing keys to listen to messages published to them, so there will be no ack mechanism to feed anything back to the sender or RabbitMQ to recover lost data. </p>
  
  <p>Any ideas what might be causing this? Client code has not changed, but messages have become more frequent. </p>
  
  <p>Hannu</p>