How should I handle this exception for API data requester? The Dostuff1,2,3 is 3 different functions that retrieves data from an API. This function is ran every minute. What I want to do is to catch the exception, but not stop the program, and rather let it retry on the next iteration. How should I solve this? I guess I shouldn't be using throw, but the code want me to return something.
public async Task Dostuff1,2,3()
{
try
{
using (HttpResponseMessage result = await _httpClient.GetAsync(Adrdess))
using (HttpContent content = result.Content)
{
result.EnsureSuccessStatusCode();
string data = await content.ReadAsStringAsync();
}
return data;
}
catch (Exception ex)
{
Console.WriteLine("Error");
throw;
}
}
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)