diff --git a/services/logs2notifications/internal/handler/email_events.go b/services/logs2notifications/internal/handler/email_events.go index 3e16e85fd9..f26c19e463 100644 --- a/services/logs2notifications/internal/handler/email_events.go +++ b/services/logs2notifications/internal/handler/email_events.go @@ -60,7 +60,7 @@ func (h *Messaging) processEmailTemplates(notification *Notification) (string, s if err != nil { eventSplit := strings.Split(notification.Event, ":") if eventSplit[0] != "problem" { - return "", "", "", "", "", nil + return "", "", "", "", "", fmt.Errorf("no matching event") } if eventSplit[1] == "insert" { tpl = "problemNotification" @@ -127,7 +127,7 @@ func (h *Messaging) processEmailTemplates(notification *Notification) (string, s case "problemNotification": eventSplit := strings.Split(notification.Event, ":") if eventSplit[0] != "problem" && eventSplit[1] == "insert" { - return "", "", "", "", "", nil + return "", "", "", "", "", fmt.Errorf("no matching event") } mainHTMLTpl = `[{{.ProjectName}}] New problem found for {{.EnvironmentName}}