code: def check_for_errors(self):
          
          if not self.exceptions:
              if not self.is_closed:
                  return
              why = AMQPConnectionError('connection was closed')
              self.exceptions.append(why)
          self.set_state(self.CLOSED)
          self.close()
          raise self.exceptions[0]
docs: Check Connection for errors.
  
          :raises AMQPConnectionError: Raises if the connection
                                       encountered an error.
          :return: