def fetch(self):
        counter = 0
        while counter <= self.timeout and not self.done:
            try:
                self.dispatch(self.transport)
                self.done = True
                self.logger.info("Done processing.")
            except urllib2.HTTPError, err:
                #code = err.code
                self.logger.error("File not found: %s" % err)
            except __HOLE__, err:
                # Connection error (socket)
                self.logger.error("IOError: %s" % err)
            except Exception, err:
                self.logger.error("SynapseException: %s" % err)
                self.done = True
            finally:
                if not self.done:
                    self.logger.info('Retrying in 2 seconds. '
                            '{0} seconds left'.format(self.timeout - counter))
                    time.sleep(2)
                    counter += 2
dataset/ETHPy150Open comodit/synapse-agent/synapse/resourcefile.py/ResourceFile.fetch