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

No distinct error code for lack of internet access #325

Open
aheze opened this issue Dec 8, 2024 · 4 comments · May be fixed by #328
Open

No distinct error code for lack of internet access #325

aheze opened this issue Dec 8, 2024 · 4 comments · May be fixed by #328
Assignees

Comments

@aheze
Copy link

aheze commented Dec 8, 2024

Hey,

When I make a request and have internet turned off, Connect immediately errors out and throws ConnectError(code: Connect.Code.unknown, message: Optional("empty error message from source"), exception: nil, details: [], metadata: [:]).

Ideally it would let me know that this was due to no internet access. Is this possible?

@rebello95
Copy link
Collaborator

Thanks for flagging this @aheze.

@jhump do you know if there's a standardized way to communicate connectivity errors through Connect errors / status codes across other implementations?

@jhump
Copy link
Member

jhump commented Dec 12, 2024

The gRPC docs suggest using "Unavailable" for this sort of network error:
https://grpc.io/docs/guides/error/#network-failures

There are cases in the Go implementation where we do try to detect and classify some errors this way. However, there are no conformance test cases for this currently. The biggest issue with adding conformance cases is with HTTP/2: if we actually break a connection as part of the test case, we will likely impact more than just the intended test case since that single connection could be used by multiple concurrent RPCs and test cases. While it wouldn't be too hard to shoehorn in test cases that are HTTP-1.1-only, the value seems low for these since some implementations have to use completely different underlying libraries for HTTP 1.1 vs. HTTP/2 (like Node JS, Dart, C++), so tests passing for HTTP 1.1 don't necessarily imply that they'd pass for HTTP/2.

@rebello95
Copy link
Collaborator

Makes sense @jhump. I can look into converting network errors into the unavailable status in ConnectError (hopefully next week).

@rebello95 rebello95 self-assigned this Dec 13, 2024
rebello95 added a commit that referenced this issue Dec 23, 2024
@rebello95
Copy link
Collaborator

#328

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 a pull request may close this issue.

3 participants