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
Now, unierr.InvalidArgumentErr(nil) will panic. Hope allow err is nil. Is it necessary? such as:
unierr.InvalidArgumentErr(nil)
func (h *Handler) Find(writer http.ResponseWriter, request *http.Request) { encoder := srvhttp.NewResponseEncoder(writer) id := request.URL.Query().Get("id") if id == "" { // return {"code":3,"message":"InvalidArgumentErr"} // unierr.InvalidArgumentErr(nil) // return {"code":3,"message":"id is required"} // unierr.InvalidArgumentErr(nil, "id is required") // return {"code":3,"message":"id is required"} encoder.EncodeError(unierr.InvalidArgumentErr(nil,"id is required")) return } m := map[string]interface{}{} h.gorm.Table("track").Where("id=?", id).Order("id desc").Find(&m) encoder.EncodeResponse(m) }
The text was updated successfully, but these errors were encountered:
I think it is reasonable to allow nil errors.
Sorry, something went wrong.
6c3f812
No branches or pull requests
Now,
unierr.InvalidArgumentErr(nil)
will panic. Hope allow err is nil. Is it necessary? such as:The text was updated successfully, but these errors were encountered: