code: def check_for_errors(self):
          
          try:
              self._connection.check_for_errors()
          except AMQPConnectionError:
              self.set_state(self.CLOSED)
              raise
  
          if self.exceptions:
              exception = self.exceptions[0]
              if self.is_open:
                  self.exceptions.pop(0)
              raise exception
  
          if self.is_closed:
              raise AMQPChannelError('channel was closed')
docs: Check connection and channel for errors.
  
          :raises AMQPChannelError: Raises if the channel encountered an error.
          :raises AMQPConnectionError: Raises if the connection
                                       encountered an error.
          :return: