From d22cdc5cbb4870ae5273934bf9b81bee367374f9 Mon Sep 17 00:00:00 2001 From: Evgeny Danienko <6655321@bk.ru> Date: Wed, 18 Oct 2017 23:29:23 +0300 Subject: [PATCH] NotifyResult doesnt return error field if success --- cmd/statusd/library.go | 4 +--- geth/common/types.go | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/statusd/library.go b/cmd/statusd/library.go index 67d3b0a79..d0ae27ad7 100644 --- a/cmd/statusd/library.go +++ b/cmd/statusd/library.go @@ -378,15 +378,13 @@ func makeJSONResponse(err error) *C.char { func Notify(token *C.char) *C.char { err := statusAPI.Notify(C.GoString(token)) - res := true errString := "" if err != nil { - res = false errString = err.Error() } out := common.NotifyResult{ - Status: res, + Status: err == nil, Error: errString, } diff --git a/geth/common/types.go b/geth/common/types.go index 1a7c9f884..5ecccf2d9 100644 --- a/geth/common/types.go +++ b/geth/common/types.go @@ -398,7 +398,7 @@ type TestConfig struct { // NotifyResult is a JSON returned from notify message type NotifyResult struct { Status bool `json:"status"` - Error string `json:"error"` + Error string `json:"error,omitempty"` } // LoadTestConfig loads test configuration values from disk