1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-26 23:53:19 +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) 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 // Done creates a new Event entry that includes the duration and appended
// loggables. // loggables.
func (eip EventInProgress) Done() { func (eip EventInProgress) Done() {