From cc370314e79d01ea1992da7aa651496a48d6a432 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 1 Aug 2024 08:01:21 -0700 Subject: [PATCH] health: don't show login error details with context cancelations Fixes #12991 Change-Id: I2a5e109395761b720ecf1069d0167cf0caf72876 Signed-off-by: Brad Fitzpatrick --- health/health.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/health/health.go b/health/health.go index f1fe8eccb..fa608420e 100644 --- a/health/health.go +++ b/health/health.go @@ -6,6 +6,7 @@ package health import ( + "context" "errors" "fmt" "maps" @@ -987,8 +988,12 @@ func (t *Tracker) updateBuiltinWarnablesLocked() { } if t.lastLoginErr != nil { + var errMsg string + if !errors.Is(t.lastLoginErr, context.Canceled) { + errMsg = t.lastLoginErr.Error() + } t.setUnhealthyLocked(LoginStateWarnable, Args{ - ArgError: t.lastLoginErr.Error(), + ArgError: errMsg, }) return } else {