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

connect.CodeOf(nil) returns connect.CodeUnknown which is different to gRPC #718

Closed
stan-stately opened this issue Mar 26, 2024 · 2 comments

Comments

@stan-stately
Copy link

Describe the bug
connect.CodeOf(nil) returns connect.CodeUnknown which is different to grpc which returns codes.OK

To Reproduce

You can repro with the following test:


func TestCodeOf(t *testing.T) {
	assert.Equal(t, connect.CodeOf(nil), connect.CodeUnknown)
	assert.Equal(t, status.Code(nil), codes.OK)
}

Additional context

  • N/A
@stan-stately stan-stately added the bug Something isn't working label Mar 26, 2024
@jhump
Copy link
Member

jhump commented Mar 26, 2024

Connect has no OK code. This is intentional since the code is only used to classify errors. Checking if the error is nil or not is the way to determine if an operation was okay.

This is not intended to be used in exactly the same fashion as grpc-go's API. We can clarify this further in the doc comments for connect.CodeOf.

@bufdev bufdev removed the bug Something isn't working label Mar 26, 2024
@stan-stately
Copy link
Author

thankyou

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

No branches or pull requests

3 participants