We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug
After connectrpc/connect-go#688 was merged into connect-go, the debug field in error details is not consistently an object but can be any JSON type.
Error JSON produced by connect-go v1.14.0 and earlier:
{ "code": "invalid_argument", "message": "bad sentence: xxx", "details": [ { "type": "google.protobuf.StringValue", "value": "Cg5zZXJ2ZXIgZGV0YWlscw", "debug": { "@type": "type.googleapis.com/google.protobuf.StringValue", "value": "server details" } } ] }
The same error JSON from connect-go v1.15.0:
{ "code": "invalid_argument", "message": "bad sentence: xxx", "details": [ { "type": "google.protobuf.StringValue", "value": "Cg5zZXJ2ZXIgZGV0YWlscw", "debug": "server details" } ] }
The current code in connect-es expects the debug field to be an object, so the new error JSON format cannot be handled after connect-go v1.15.0.
connect-es/packages/connect/src/protocol-connect/error-json.ts
Line 65 in e580470
To Reproduce Return the following error in a connect-go server:
err := connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("bad sentence: %s", "xxx")) errDetail, _ := connect.NewErrorDetail(&wrapperspb.StringValue{Value: "server details"}) err.AddDetail(errDetail)
Expected error:
ConnectError: [invalid_argument] bad sentence: xxx
Actual error:
ConnectError: [invalid_argument] HTTP 400
Environment (please complete the following information):
1.4.0
v1.5.0
Additional context This code might fix the issue, but I am not familiar with TypeScript, so I am just reporting it:
typeof detail.type != "string" || - typeof detail.value != "string" || - ("debug" in detail && typeof detail.debug != "object") + typeof detail.value != "string" ) {
The text was updated successfully, but these errors were encountered:
Thank you for the detailed report. @jhump should this be added to conformance suite?
Sorry, something went wrong.
@jhump should this be added to conformance suite?
That's probably a good idea. The well-known types seem to always be causing problems :(
Successfully merging a pull request may close this issue.
Describe the bug
After connectrpc/connect-go#688 was merged into connect-go, the debug field in error details is not consistently an object but can be any JSON type.
Error JSON produced by connect-go v1.14.0 and earlier:
The same error JSON from connect-go v1.15.0:
The current code in connect-es expects the debug field to be an object, so the new error JSON format cannot be handled after connect-go v1.15.0.
connect-es/packages/connect/src/protocol-connect/error-json.ts
Line 65 in e580470
To Reproduce
Return the following error in a connect-go server:
Expected error:
Actual error:
Environment (please complete the following information):
1.4.0
v1.5.0
and later.Additional context
This code might fix the issue, but I am not familiar with TypeScript, so I am just reporting it:
The text was updated successfully, but these errors were encountered: