Skip to content

Conversation

jacdevos
Copy link
Contributor

@jacdevos jacdevos commented Jan 8, 2015

This issue seems to plague a lot of people.

Execute (sync) and ExecuteAsync handle exceptions by swallowing them and setting the Error properties on the response object. This change makes ExecuteTaskAsync also swallow its errors by NOT invoking taskCompletionSource.TrySetException(response.ErrorException) in RestClient.Async.cs.

The change in Http.Async.cs was simply to populate the ErrorException with a ResponseStatus.ToWebException() if empty, making it even more consistent with Execute (sync).

Most of the code changes were changes to tests that expected ExecuteTaskAsync to throw exceptions.

@jacdevos jacdevos changed the title Fix to issue in #466 and other. ExecuteTaskAsync should not throw exceptions Fix to issue in #466 and others. ExecuteTaskAsync should not throw exceptions Jan 8, 2015
@jacdevos
Copy link
Contributor Author

Hi Michael,

Let me know when you get a chance to look at pulling this in. Just a correction, it fixes #552 and related issues rather than #466.

Hope it helps.

@hallem
Copy link
Member

hallem commented Jan 16, 2015

Thanks for the PR. I'll try and take a look at it this weekend.

hallem added a commit that referenced this pull request Jan 22, 2015
…tionsFixed

Fix to issue in #522 and others. ExecuteTaskAsync should not throw exceptions
@hallem hallem merged commit ce49d8b into restsharp:master Jan 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants