Skip to content

Commit 390d3ec

Browse files
committed
Fix a couple of minor bugs: log issue creation on success, not failure; and return early if receiver creation fails.
1 parent f22431d commit 390d3ec

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

cmd/jiralert/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ func main() {
8282
r, err := jiralert.NewReceiver(conf, tmpl)
8383
if err != nil {
8484
errorHandler(w, http.StatusInternalServerError, err, conf.Name, &data)
85+
return
8586
}
8687
if retry, err := r.Notify(&data); err != nil {
8788
var status int

notify.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (r *Receiver) Notify(data *alertmanager.Data) (bool, error) {
104104
return false, r.tmpl.err
105105
}
106106
retry, err = r.create(issue)
107-
if err != nil {
107+
if err == nil {
108108
log.Infof("Issue created: key=%s ID=%s", issue.Key, issue.ID)
109109
}
110110
return retry, err

0 commit comments

Comments
 (0)