Make OnWorker callback return an error

This lets us get rid of a few more calls to Error(), and it simplifies things
for clients of OnWorker: they can simply return an error from their callback
like we do everywhere else.
This commit is contained in:
Stefan Haller 2024-04-14 20:06:25 +02:00
parent 5396a70661
commit 1869fda800
12 changed files with 30 additions and 44 deletions

View file

@ -151,7 +151,7 @@ func (self *guiCommon) OnUIThread(f func() error) {
self.gui.onUIThread(f)
}
func (self *guiCommon) OnWorker(f func(gocui.Task)) {
func (self *guiCommon) OnWorker(f func(gocui.Task) error) {
self.gui.onWorker(f)
}