1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-24 22:38:27 +08:00

feat(eventlog) add SetError to EventInProgress

This commit is contained in:
Brian Tiger Chow
2015-01-29 00:44:28 -08:00
parent 8f16a4efff
commit 1dd1e7339b

View File

@ -120,6 +120,13 @@ func (eip EventInProgress) Append(l Loggable) {
eip.loggables = append(eip.loggables, l)
}
// SetError includes the provided error
func (eip EventInProgress) SetError(err error) {
eip.loggables = append(eip.loggables, LoggableMap{
"error": err.Error(),
})
}
// Done creates a new Event entry that includes the duration and appended
// loggables.
func (eip EventInProgress) Done() {