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

rest.ReadRESTReq() is commonly misused #3490

Closed
4 tasks
alessio opened this issue Feb 4, 2019 · 1 comment
Closed
4 tasks

rest.ReadRESTReq() is commonly misused #3490

alessio opened this issue Feb 4, 2019 · 1 comment
Assignees
Labels
Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity.

Comments

@alessio
Copy link
Contributor

alessio commented Feb 4, 2019

E.g.

		err := rest.ReadRESTReq(w, r, cdc, &req)
		if err != nil {
			rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error())
			return
		}

There is no need to handle/write the error response as ReadRESTReq does that on its own.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@alessio alessio added the Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity. label Feb 4, 2019
@alessio alessio changed the title client.ReadRESTReq() is commonly misused rest.ReadRESTReq() is commonly misused Feb 4, 2019
@alessio alessio self-assigned this Feb 4, 2019
alessio pushed a commit that referenced this issue Feb 4, 2019
@jackzampolin
Copy link
Member

Looks to be addressed in one of your PRs @alessio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity.
Projects
None yet
Development

No branches or pull requests

2 participants