Merge PR #3691: Minor Error Message Cleanup

* cleanup error messages

* Add pending log entry

* Rename Message to Error in ErrorResponse
This commit is contained in:
Alexander Bezobchuk
2019-02-21 03:49:57 -05:00
committed by frog power 4000
parent ab9de3a7f1
commit 992dc8b2dc
5 changed files with 23 additions and 18 deletions
+4 -4
View File
@@ -111,13 +111,13 @@ func ReadRESTReq(w http.ResponseWriter, r *http.Request, cdc *codec.Codec, req i
// ErrorResponse defines the attributes of a JSON error response.
type ErrorResponse struct {
Code int `json:"code,omitempty"`
Message string `json:"message"`
Code int `json:"code,omitempty"`
Error string `json:"error"`
}
// NewErrorResponse creates a new ErrorResponse instance.
func NewErrorResponse(code int, msg string) ErrorResponse {
return ErrorResponse{Code: code, Message: msg}
func NewErrorResponse(code int, err string) ErrorResponse {
return ErrorResponse{Code: code, Error: err}
}
// WriteErrorResponse prepares and writes a HTTP error