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

Problem of status code being StatusCode.Internal in Airplane mode, etc. #75

Conversation

trapezoid
Copy link
Contributor

@trapezoid trapezoid commented Jul 1, 2024

Grpc.Net.Client has an implementation that interprets the StatusCode as Unavailable if an exception derived from SocketException/IOException is included as InnerException among HttpRequestExceptions. In the current YetAnotherHttpHandler, InnerException is not set, so when an error occurs in an offline state, the StatusCode becomes Internal, and the behavior is different from when using the genuine HttpHandler.

Changed to pass the exception (IOException) as InnerException to HttpRequestException, which is thrown when an exception occurs when getting results with ResponseContext.GetResponseAsync.

Changed to pass the exception (IOException) as InnerException to HttpRequestException, which is thrown when an exception occurs when getting results with `ResponseContext.GetResponseAsync`.

`Grpc.Net.Client` has an implementation that interprets the StatusCode as Unavailable if an exception derived from SocketException is included as InnerException among HttpRequestExceptions.
In the current YetAnotherHttpHandler, InnerException is not set, so when an error occurs in an offline state, the StatusCode becomes Internal, and the behavior is different from when using the genuine HttpHandler.
@mayuki
Copy link
Member

mayuki commented Jul 2, 2024

Looks good to me. Thanks!

@mayuki mayuki merged commit 31edb77 into Cysharp:main Jul 2, 2024
14 checks passed
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