tricrypt/tui/channel_errors.go

23 lines
396 B
Go
Raw Permalink Normal View History

2024-05-01 16:21:10 +02:00
package tui
2024-05-01 16:32:27 +02:00
import (
"log"
"git.qowevisa.me/Qowevisa/gotell/errors"
)
2024-05-01 16:21:10 +02:00
func (t *TUI) launchErrorsChannel() error {
if t.errorsChannel == nil {
return errors.WrapErr("t.errors", errors.NOT_INIT)
}
go func() {
for err := range t.errorsChannel {
if err != nil {
2024-05-01 16:32:27 +02:00
log.Printf("ERROR: %#v\n", err)
2024-05-01 16:21:10 +02:00
t.createNotification(err.Error(), CONST_ERROR_N_TITLE)
}
}
}()
return nil
}