'Try to send the request again while doing some error handling.'

def _retry(self, req, grep, url_error):

    req.retries_left -= 1
    if (req.retries_left > 0):
        msg = 'Re-sending    request    "%s"    after    initial    exception:    "%s"'
        om.out.debug((msg % (req, url_error)))
        return self.send(req, grep=grep)
    else:
        error_str = (get_exception_reason(url_error) or str(url_error))
        raise HTTPRequestException(error_str, request=req)
