From 077b20dd9a17149585d44e45d517c9ec7494eb32 Mon Sep 17 00:00:00 2001 From: Tyler Reid Date: Thu, 1 Jul 2021 09:19:25 -0500 Subject: [PATCH] Add error check when creating sns session Signed-off-by: Tyler Reid --- notify/sns/sns.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/notify/sns/sns.go b/notify/sns/sns.go index 5b88250d..77501f66 100644 --- a/notify/sns/sns.go +++ b/notify/sns/sns.go @@ -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