private function handleRequestException(Throwable $exception, $method, $path, array $params, $limit, $offset)
    {
        if ($this->retries >= 4) {
            $this->retries = 0;

            throw $exception;
        }

        ++$this->retries;

        if ($exception instanceof LoginExpiredException) {
            $this->accessToken = null;
        }

        if ($exception instanceof LimitReachedException) {
            if ($exception->getRetryAfter() > 60 * 15) {
                $this->logger->error('rate limit reached and retry after value is too high, aborting');
            } else {
                $this->logger->warning(
                    sprintf('rate limit reached, retrying in %s seconds', $exception->getRetryAfter())
                );

                sleep($exception->getRetryAfter());
            }
        } else {
            sleep(10);
        }

        return $this->request($method, $path, $params, $limit, $offset);
    }
private function handleRequestException(Throwable $exception, $method, $path, array $params, $limit, $offset)
    {
        if ($this->retries >= 4) {
            $this->retries = 0;

            throw $exception;
        }

        ++$this->retries;

        if ($exception instanceof LoginExpiredException) {
            $this->accessToken = null;
        }

        if ($exception instanceof LimitReachedException) {
            if ($exception->getRetryAfter() > 60 * 15) {
                $this->logger->error('rate limit reached and retry after value is too high, aborting');
            } else {
                $this->logger->warning(
                    sprintf('rate limit reached, retrying in %s seconds', $exception->getRetryAfter())
                );

                sleep($exception->getRetryAfter());
            }
        } else {
            sleep(10);
        }

        return $this->request($method, $path, $params, $limit, $offset);
    }
@param Throwable $exception
@param string    $method
@param string    $path
@param array     $params
@param int       $limit
@param int       $offset

@return array