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

Reworked Error message in newParam() in services.go #1894

Conversation

gunadhya
Copy link
Contributor

References to other Issues or PRs

Fixes #1863

Have you read the Contributing Guidelines?

Yes

Brief description of what is fixed or changed

Changes to error format

Before:

return Parameter{}, fmt.Errorf("aggregate type %s in parameter of %s.%s: %s", target.Type, meth.Service.GetName(), meth.GetName(), path)

After:

return Parameter{}, fmt.Errorf("%s.%s: %s is a protobuf message type. Protobuf message types cannot be used as path parameters, use a scalar value type (such as string) instead", meth.Service.GetName(), meth.GetName(), path)

Other comments

@google-cla google-cla bot added the cla: yes label Jan 12, 2021
Copy link
Collaborator

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

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

Thanks for this PR, do you think you could add a test which triggers this error? You can look at

func TestExtractServicesWithPathParam(t *testing.T) {
for an example of a test that uses a path parameter.

@johanbrandhorst johanbrandhorst merged commit a9a27c4 into grpc-ecosystem:master Jan 18, 2021
@johanbrandhorst
Copy link
Collaborator

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Poor error message when using message in path parameter
2 participants