def on_failure(self, entity):
        """
        Callback function when there is a failure in a connection to whatsapp 
        server
        """
        logger.error("Login failed, reason: %s" % entity.getReason())
        self.connected = False
Callback function when there is a failure in a connection to whatsapp 
        server