Add error check when creating sns session

Signed-off-by: Tyler Reid <tyler.reid@grafana.com>
This commit is contained in:
Tyler Reid 2021-07-01 09:19:25 -05:00
parent 1322abdc08
commit 077b20dd9a

View File

@ -83,6 +83,13 @@ func (n *Notifier) Notify(ctx context.Context, alert ...*types.Alert) (bool, err
},
Profile: n.conf.Sigv4.Profile,
})
if err != nil {
if e, ok := err.(awserr.RequestFailure); ok {
return n.retrier.Check(e.StatusCode(), strings.NewReader(e.Message()))
} else {
return true, err
}
}
if n.conf.Sigv4.RoleARN != "" {
var stsSess *session.Session