]> git.giacomolli.uk - onechat/blobdiff - daemon.go
Complete context on forwarded local errors
[onechat] / daemon.go
index 962070a11e7f38b84709173e96b3c17395b13a6c..7945c2b5638a49f81aa4f1369bca67ea0327cadd 100644 (file)
--- a/daemon.go
+++ b/daemon.go
@@ -359,9 +359,14 @@ func daemon(ctx context.Context, out io.Writer) (err error) {
                logger.Info("Telegram bot started")
        }
 
-       return daemonServe(ctx, listener, telegram, whatsapp, schedules, func(notify func(Event)) (*TurnLoop, error) {
+       err = daemonServe(ctx, listener, telegram, whatsapp, schedules, func(notify func(Event)) (*TurnLoop, error) {
                return root.Loop(whatsapp, notify)
        }, agents[1:]...)
+       if err != nil {
+               return fmt.Errorf("serve daemon: %w", err)
+       }
+
+       return nil
 }
 
 // daemonListenSocket listens on the Unix socket at path, with mode 0600. The