diff options
Diffstat (limited to 'hived/alertHandlers.go')
-rw-r--r-- | hived/alertHandlers.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hived/alertHandlers.go b/hived/alertHandlers.go index 6fb7614..54fb042 100644 --- a/hived/alertHandlers.go +++ b/hived/alertHandlers.go @@ -146,10 +146,13 @@ func (alertHandler Handler) HandleAlertGet(writer http.ResponseWriter, request * } var ErrorString string + var IsSuccessful bool if err == nil { ErrorString = "" + IsSuccessful = true } else { ErrorString = err.Error() + IsSuccessful = false } writer.Header().Add("Content-Type", "application/json") @@ -159,7 +162,7 @@ func (alertHandler Handler) HandleAlertGet(writer http.ResponseWriter, request * Error string `json:"error"` Key string `json:"key"` Expr string `json:"expr"` - }{IsSuccessful: true, Error: ErrorString, Key: identifier, Expr: redisResultString}) + }{IsSuccessful: IsSuccessful, Error: ErrorString, Key: identifier, Expr: redisResultString}) if err != nil { log.Error().Err(err) |