I don't think the following code is very helpful for real error handling scenarios:
string responseBody = await response.Raw.Content.ReadAsStringAsync();
if (response.StatusCode >= 200 && response.StatusCode < 400)
{
return JsonSerializer.Deserialize<PaginatedScreeningQuestionList>(responseBody);
}
throw new Exception(responseBody);
It's impossible to tell what caused the exception when Exception is already the base class for all exceptions. Also, the status code is no longer available for inspection
I don't think the following code is very helpful for real error handling scenarios:
It's impossible to tell what caused the exception when Exception is already the base class for all exceptions. Also, the status code is no longer available for inspection
Actually, I've just spotted in your docs that there is already an improvement in the works, very aligned with what I was hoping for: https://github.com/merge-api/merge-csharp-client?tab=readme-ov-file#exception-handling
When will that documentation become true?