diff --git a/pkg/alertmanager/alertmanagernotify/email/email_test.go b/pkg/alertmanager/alertmanagernotify/email/email_test.go index 9a6d56d1cf..30cbf2e2cb 100644 --- a/pkg/alertmanager/alertmanagernotify/email/email_test.go +++ b/pkg/alertmanager/alertmanagernotify/email/email_test.go @@ -636,7 +636,7 @@ func TestEmailConfigMissingAuthParam(t *testing.T) { require.Equal(t, "missing password for PLAIN auth mechanism; missing password for LOGIN auth mechanism", err.Error()) } -func TestEmailNoUsernameStillOk(t *testing.T) { +func TestEmailNoUsernameCustomError(t *testing.T) { email := &Email{ conf: &config.EmailConfig{}, tmpl: &template.Template{}, logger: promslog.NewNopLogger(), } diff --git a/pkg/alertmanager/alertmanagernotify/pagerduty/pagerduty.go b/pkg/alertmanager/alertmanagernotify/pagerduty/pagerduty.go index 25b09d0839..b6d382d979 100644 --- a/pkg/alertmanager/alertmanagernotify/pagerduty/pagerduty.go +++ b/pkg/alertmanager/alertmanagernotify/pagerduty/pagerduty.go @@ -316,7 +316,7 @@ func (n *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error) } if n.conf.Timeout > 0 { - nfCtx, cancel := context.WithTimeoutCause(ctx, n.conf.Timeout, errors.NewInternalf(errors.CodeInternal, "configured pagerduty timeout reached (%s)", n.conf.Timeout)) + nfCtx, cancel := context.WithTimeoutCause(ctx, n.conf.Timeout, errors.NewInternalf(errors.CodeTimeout, "configured pagerduty timeout reached (%s)", n.conf.Timeout)) defer cancel() ctx = nfCtx } diff --git a/pkg/alertmanager/alertmanagernotify/slack/slack.go b/pkg/alertmanager/alertmanagernotify/slack/slack.go index 2ef0478243..cd10e0c787 100644 --- a/pkg/alertmanager/alertmanagernotify/slack/slack.go +++ b/pkg/alertmanager/alertmanagernotify/slack/slack.go @@ -202,7 +202,7 @@ func (n *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error) } if n.conf.Timeout > 0 { - postCtx, cancel := context.WithTimeoutCause(ctx, n.conf.Timeout, errors.NewInternalf(errors.CodeInternal, "configured slack timeout reached (%s)", n.conf.Timeout)) + postCtx, cancel := context.WithTimeoutCause(ctx, n.conf.Timeout, errors.NewInternalf(errors.CodeTimeout, "configured slack timeout reached (%s)", n.conf.Timeout)) defer cancel() ctx = postCtx } diff --git a/pkg/alertmanager/alertmanagernotify/webhook/webhook.go b/pkg/alertmanager/alertmanagernotify/webhook/webhook.go index 4ed973c9da..0321daed62 100644 --- a/pkg/alertmanager/alertmanagernotify/webhook/webhook.go +++ b/pkg/alertmanager/alertmanagernotify/webhook/webhook.go @@ -114,7 +114,7 @@ func (n *Notifier) Notify(ctx context.Context, alerts ...*types.Alert) (bool, er } if n.conf.Timeout > 0 { - postCtx, cancel := context.WithTimeoutCause(ctx, n.conf.Timeout, errors.NewInternalf(errors.CodeInternal, "configured webhook timeout reached (%s)", n.conf.Timeout)) + postCtx, cancel := context.WithTimeoutCause(ctx, n.conf.Timeout, errors.NewInternalf(errors.CodeTimeout, "configured webhook timeout reached (%s)", n.conf.Timeout)) defer cancel() ctx = postCtx }