This repository was archived by the owner on Feb 16, 2024. It is now read-only.

Description
Hi,
I am struggling with this:
I need to make the method (MainAction) repeat on error, but after another method (ActionOnError) would do something with success.
This is quasi code, not working:
public void MainAction()
{
_cognitoAuthorizationController.GetUserSubId("accessToken")
.Subscribe(r =>
{
Debug.Log("Succes");
},
onError:
err =>
{
Debug.Log("err " + err.Message);
ActionOnError().Subscribe(
success =>
{
if (success)
{
MainAction();
}
});
});
}
public IObservable<string> GetUserSubId(string accessToken)
{
return GetUserId(accessToken).ToObservable();
}
public async Task<string> GetUserId(string accessToken)
{
Debug.Log("Getting user's id...");
string subId = "";
Task<GetUserResponse> responseTask =
_provider.GetUserAsync(new GetUserRequest
{
AccessToken = accessToken
});
GetUserResponse responseObject = await responseTask;
return responseObject.subId;
}
Thank you in advance for any help.