From 53029c2a09982a80de794907bbabca53f2da7772 Mon Sep 17 00:00:00 2001 From: Andrew Ayer Date: Tue, 17 Jun 2025 10:52:32 -0400 Subject: [PATCH] Imrove some comments --- monitor/process.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/monitor/process.go b/monitor/process.go index 3f259f0..3dc3ced 100644 --- a/monitor/process.go +++ b/monitor/process.go @@ -107,8 +107,15 @@ func processCertificate(ctx context.Context, config *Config, entry *LogEntry, ce } chain, chainErr := getChain(ctx) - if errors.Is(chainErr, context.Canceled) { - return chainErr + if chainErr != nil { + if ctx.Err() != nil { + // Getting chain failed, but it was probably because our context + // has been canceled, so just act like we never called getChain. + return ctx.Err() + } + // Although getting the chain failed, we still want to notify + // the user about the matching certificate. We'll include chainErr in the + // notification so the user knows why the chain is missing or incorrect. } cert := &DiscoveredCert{