public function retry(callable $callback)
    {
        $userHandlerCloned = $providerHandlerCloned = false;

        return \ScriptFUSION\Retry\retry(
            $this->maxFetchAttempts,
            $callback,
            function (\Exception $exception) use (&$userHandlerCloned, &$providerHandlerCloned) {
                // Throw exception instead of retrying, if unrecoverable.
                if (!$exception instanceof RecoverableConnectorException) {
                    throw $exception;
                }

                // Call provider's exception handler, if defined.
                if ($this->resourceFetchExceptionHandler) {
                    self::invokeHandler($this->resourceFetchExceptionHandler, $exception, $providerHandlerCloned);
                }

                // Call user's exception handler.
                self::invokeHandler($this->fetchExceptionHandler, $exception, $userHandlerCloned);
            }
        );
    }