Skip to content

Commit ed50aca

Browse files
authored
fix: don't log error on context cancel (#9463)
Signed-off-by: Spike Curtis <spike@coder.com>
1 parent 73976dd commit ed50aca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

coderd/workspaceagents.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -1841,7 +1841,10 @@ func (api *API) workspaceAgentReportLifecycle(rw http.ResponseWriter, r *http.Re
18411841
ReadyAt: readyAt,
18421842
})
18431843
if err != nil {
1844-
logger.Error(ctx, "failed to update lifecycle state", slog.Error(err))
1844+
if !xerrors.Is(err, context.Canceled) {
1845+
// not an error if we are canceled
1846+
logger.Error(ctx, "failed to update lifecycle state", slog.Error(err))
1847+
}
18451848
httpapi.InternalServerError(rw, err)
18461849
return
18471850
}

0 commit comments

Comments
 (0)