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

Store status code in exception for ProxyTunnelError #105610

Merged
merged 5 commits into from
Jul 31, 2024

Conversation

stephentoub
Copy link
Member

@stephentoub stephentoub commented Jul 29, 2024

Fixes #105546
Closes #66329

@antonfirsov, @wfurt, is it by-design or an accident that we didn't do this? The original PR:
https://github.com/dotnet/runtime/pull/88974/files#diff-bc2faad6c76ecb9b115e305763eb55ebfde74de1eee27ed549e5edaabb097a99R1767
has it with the status code only going into the error message but not being used to intialize the property.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@wfurt wfurt left a comment

Choose a reason for hiding this comment

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

LGTM.
I don't know if this was the reason but at some point there was concern about mingling status from proxy vs actual server. #48679

It seems like this effectively solves #66329, right? e.g. the ask is the same.

@stephentoub
Copy link
Member Author

It seems like this effectively solves #66329, right? e.g. the ask is the same.

I believe so

I don't know if this was the reason but at some point there was concern about mingling status from proxy vs actual server. #48679

I read through that and it doesn't actually seem like being about status, rather than the response couldn't be differentiated from the actual response, and the resulting fix was to throw this exception. Now that an exception is being thrown and that exception can carry a status code, providing that status code seems like the correct answer. It's clear it's a proxy tunnel failure from the error enum.

@wfurt
Copy link
Member

wfurt commented Jul 30, 2024

that make sen se to me. Can we add test(s) and perhaps also update documentation to make it clear?

Copy link
Member

@antonfirsov antonfirsov left a comment

Choose a reason for hiding this comment

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

@antonfirsov, @wfurt, is it by-design or an accident that we didn't do this?

HttpRequestException.StatusCode has been introduced in #32455 but hasn't been systematically forwarded for cases other than trivial EnsureSuccessStatusCode() validations. #88974 didn't change anything in that regard.

@stephentoub
Copy link
Member Author

but hasn't been systematically forwarded for cases

Meaning we're likely missing the status code being included in the exception in other cases? Is there an open issue for auditing all of them?

@antonfirsov
Copy link
Member

Opened #105700.

@stephentoub stephentoub merged commit aa06639 into dotnet:main Jul 31, 2024
84 checks passed
@stephentoub stephentoub deleted the proxytunnelstatus branch July 31, 2024 16:15
@github-actions github-actions bot locked and limited conversation to collaborators Aug 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants