Don't return nil, nil in (*AuditWriter).tryResumeStream (#10254)

* Fix logic problem in (*AuditWriter).tryResumeStream

If all the attempts are discarded due to timeouts with no errors
we might return nil, nil in tryResumeStream, this adds a message
to the potentially nil error that makes it an actual error.

* Use `LimitExceeded` instead of wrapping the error
This commit is contained in:
Edoardo Spadolini
2022-02-11 10:56:30 +00:00
committed by GitHub
parent de73212820
commit 8babe54f13
+1 -1
View File
@@ -533,7 +533,7 @@ func (a *AuditWriter) tryResumeStream() (apievents.Stream, error) {
return nil, trace.ConnectionProblem(a.closeCtx.Err(), "operation has been canceled")
}
}
return nil, trace.Wrap(err)
return nil, trace.LimitExceeded("audit stream resume attempts exhausted, last error: %v", err)
}
func (a *AuditWriter) updateStatus(status apievents.StreamStatus) {