code: def _link_error_cb(self, errmsg):
          
          logger.warning('Got link error callback [%s] in state [%s]',
                         errmsg, self.state)
          if (self.link is not None):
              self.link.close()
          self.link = None
          if (self.state == State.INITIALIZED):
              self.connection_failed.call(self.link_uri, errmsg)
          if (self.state == State.CONNECTED or
                  self.state == State.SETUP_FINISHED):
              self.disconnected.call(self.link_uri)
              self.connection_lost.call(self.link_uri, errmsg)
          self.state = State.DISCONNECTED
docs: Called from the link driver when there's an error