Skip to content
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

Event Handlers for Async requests resulting in exceptions don't call the OnResponse method #849

Open
jweber opened this issue Sep 24, 2024 · 0 comments
Labels

Comments

@jweber
Copy link

jweber commented Sep 24, 2024

Event Handlers for Async requests resulting in exceptions don't call the OnResponse method


Describe the bug

Calls that result in an Exception thrown by the client (e.g. NotFound) only call the OnResponse() method of registered event handlers if the call is not made using the Async overloads.

It appears that the HandleResponse method which can throw these exceptions is called before the EventHandlers are in the MakeRequestAsync method, but in the synchronous implementation, HandleResponse is called after the EventHandlers are run.

To Reproduce

Make the same call synchronously and asynchronously that results in a failure using a client with an event handler registered, and observe that the OnResponse method of the event handler is only fired for the synchronous call.

Expected behavior

The OnResponse method for event handlers should fire before an exception is thrown by the HandleResponse method.

Your Environment

  • Which version of this library are you using? 4.58.0
@jweber jweber added the bug? label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant