fix: don't log error on context cancel (#9463)

Signed-off-by: Spike Curtis <spike@coder.com>
This commit is contained in:
Spike Curtis
2023-08-31 12:08:18 +04:00
committed by GitHub
parent 73976dd076
commit ed50acaabf

View File

@ -1841,7 +1841,10 @@ func (api *API) workspaceAgentReportLifecycle(rw http.ResponseWriter, r *http.Re
ReadyAt: readyAt,
})
if err != nil {
logger.Error(ctx, "failed to update lifecycle state", slog.Error(err))
if !xerrors.Is(err, context.Canceled) {
// not an error if we are canceled
logger.Error(ctx, "failed to update lifecycle state", slog.Error(err))
}
httpapi.InternalServerError(rw, err)
return
}