Hi
I think it's a bad design to hide the Content property of the derived class ApiException. The reason is that if you don't catch ValidationApiException but catch ApiException, you expect to get the Content property as string. However, if the real content is a problem+json document, it's null in the ApiException.
A better approach would be to have a new property in the ValidationApiException class that returns the ProblemDetails and keep Content as text, giving the client a chance to deserialize the problem itself.
Staffan
I'm having this exact issue right now. Took me 30 minutes to finally track down this issue.
It's because the request object is disposed when catching the exception. I'll look at how to do this in a better fashion.
@jamiehowarth0 See my PR!
I'm facing this exact same issue.
Most helpful comment
@jamiehowarth0 See my PR!