progress: Stop event on error
Ensures that we set an `endTime` when an error event is published.
@@ -68,9 +68,12 @@ func (w *ttyWriter) Event(e Event) {
}
if _, ok := w.events[e.ID]; ok {
event := w.events[e.ID]
- if event.Status != Done && e.Status == Done {
+ switch e.Status {
+ case Done, Error:
+ if event.Status != e.Status {
event.stop()
}
+ }
event.Status = e.Status
event.Text = e.Text
event.StatusText = e.StatusText
