Merge PR #2444: Standardize REST error responses

This commit is contained in:
Federico Kunze
2018-10-19 18:55:20 +02:00
committed by Christopher Goes
parent 505c356f20
commit ad355d6c69
20 changed files with 160 additions and 168 deletions
+3 -3
View File
@@ -26,12 +26,12 @@ const (
// WriteErrorResponse prepares and writes a HTTP error
// given a status code and an error message.
func WriteErrorResponse(w http.ResponseWriter, status int, msg string) {
func WriteErrorResponse(w http.ResponseWriter, status int, err string) {
w.WriteHeader(status)
w.Write([]byte(msg))
w.Write([]byte(err))
}
// WriteGasEstimateResponse prepares and writes an HTTP
// WriteSimulationResponse prepares and writes an HTTP
// response for transactions simulations.
func WriteSimulationResponse(w http.ResponseWriter, gas int64) {
w.WriteHeader(http.StatusOK)