]> git.giacomolli.uk - onechat/blobdiff - terminal.go
Add local context to chat operation failures
[onechat] / terminal.go
index da0d78aa4fb6c95160ed1f42fb77631820a426d2..db259fb15c75c3d4ea2221a35812111f3ba5f3aa 100644 (file)
@@ -30,13 +30,13 @@ var errTerminalDaemonClosed = errors.New("the daemon closed the connection")
 func terminal(ctx context.Context, in io.Reader, out io.Writer) error {
        dir, err := dataDir()
        if err != nil {
-               return err
+               return fmt.Errorf("find data directory: %w", err)
        }
 
        path := filepath.Join(dir, socketFileName)
        err = checkSocketPath(path)
        if err != nil {
-               return err
+               return fmt.Errorf("check terminal socket path: %w", err)
        }
 
        var dialer net.Dialer