NotifyResult doesnt return error field if success

This commit is contained in:
Evgeny Danienko 2017-10-18 23:29:23 +03:00
parent 9efed591da
commit d22cdc5cbb
No known key found for this signature in database
GPG Key ID: BC8C34D8B45BECBF
2 changed files with 2 additions and 4 deletions

View File

@ -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,
}

View File

@ -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