Pokemon-Go-Rocket-API
Pokemon-Go-Rocket-API copied to clipboard
What is the meaning of IApiFailureStrategy and how should i get it to work?
I trying to get login to work with latest code and there is a new parameter to the Client for a IApiFailureStrategy object.
How did you like us to use it?
I think the general idea of it is that you can setup different number of retries. But for me it seems like a work in progress because it doesn't really allow to handle different failures.
i can not get latest code to work becouse of i dont understand what i should return as value then the enum not works to return in the function named HandleApiFailure in the ApiFailureStrategy
You can handle the failures.
Here is a example code:
internal class APIFailure : IApiFailureStrategy
{
public async Task<ApiOperation> HandleApiFailure(RequestEnvelope request, ResponseEnvelope response)
{
await Task.Delay(500);
return ApiOperation.Retry;
}
public void HandleApiSuccess(RequestEnvelope request, ResponseEnvelope response)
{
}
}
I dont handle the error, just await and try, try again.. and when success, i do not anything xD