mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: stop logging errors on cancel in notifier (#15186)
fixes https://github.com/coder/internal/issues/121 We shouldn't log errors when context is canceled, e.g. on shutdown. This breaks our tests and alarms customers needlessly.
This commit is contained in:
@@ -7,19 +7,15 @@ import (
|
||||
"text/template"
|
||||
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"cdr.dev/slog"
|
||||
)
|
||||
|
||||
func (n *notifier) fetchHelpers(ctx context.Context) (map[string]any, error) {
|
||||
appName, err := n.fetchAppName(ctx)
|
||||
if err != nil {
|
||||
n.log.Error(ctx, "failed to fetch app name", slog.Error(err))
|
||||
return nil, xerrors.Errorf("fetch app name: %w", err)
|
||||
}
|
||||
logoURL, err := n.fetchLogoURL(ctx)
|
||||
if err != nil {
|
||||
n.log.Error(ctx, "failed to fetch logo URL", slog.Error(err))
|
||||
return nil, xerrors.Errorf("fetch logo URL: %w", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user