def _handle_retry(self, resp):
        exc_t, exc_v, exc_tb = sys.exc_info()
        if exc_t is None:
            raise TypeError('Must be called in except block.')
        retry_on_exc = tuple(
            (x for x in self._retry_on if inspect.isclass(x)))
        retry_on_codes = tuple(
            (x for x in self._retry_on if isinstance(x, int)))
        if issubclass(exc_t, ZendeskError):
            code = exc_v.error_code
            if exc_t not in retry_on_exc and code not in retry_on_codes:
                six.reraise(exc_t, exc_v, exc_tb)
        else:
            if not issubclass(exc_t, retry_on_exc):
                six.reraise(exc_t, exc_v, exc_tb)
        if resp is not None:
            try:
                retry_after = float(resp.headers.get('Retry-After', 0))
                time.sleep(retry_after)
            except (TypeError, ValueError):
                pass
        return True