-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
ThrowOnAnyError does not throw #1511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@alexeyzimarev - Any estimate on when this fix will be published to the NuGet feed? We're using 106.11.7 and this is still not throwing the error. I also tried the 106.11.8-alpha.0.14 package, but that did not seem to work either. |
@FrediKats @alexeyzimarev FYI, this is still happening in 106.12.0. |
@FrediKats @alexeyzimarev This still seems to be a problem in 107.0.2 |
Thanks 😀, that was quick 👍 |
Expected Behavior
When creating a RestClient, initialized with
ThrowOnAnyError = true
, I expect an exception to be thrown when a request fails, as per the documentation: Error HandlingActual Behavior
No exception is thrown.
For sync requests, the exception is caught in
ExecuteRequest
, for async requests it's caught inGetStyleMethodInternalAsync
. In both cases the exception is consumed and a HttpResponse with error info is returned. No exception gets thrown. Instead, the error response is returned, regardless of the value ofThrowOnAnyError
.Steps to Reproduce the Problem
A simple request against a non-existing endpoint shows the problem:
Specifications
The text was updated successfully, but these errors were encountered: