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

UnexpectedHttpStatusCodeException: more verbose message #333

Merged
merged 4 commits into from
May 28, 2024

Conversation

inikulshin
Copy link
Contributor

@inikulshin inikulshin commented May 28, 2024

Add response.Content (as string) to exception message.

StatusCode = statusCode;
}

public static async Task<UnexpectedHttpStatusCodeException> FromHttpResponseMessageAsync(HttpResponseMessage response)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also might consider adding cancellation token here...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pliner well, ok.

However, HttpContent.ReadAsStringAsync(CancellationToken) exists since .NET 5.0 only.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not know that, sorry :(

Pliner
Pliner previously approved these changes May 28, 2024
@inikulshin
Copy link
Contributor Author

@Pliner I added CancellationToken, please review.

Copy link
Member

@Pliner Pliner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@Pliner Pliner merged commit 5c4d635 into master May 28, 2024
8 checks passed
@Pliner Pliner deleted the in-delete-query branch May 28, 2024 13:46
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