You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: daemon.go
    path of file: ./repos/encore/cli/cmd/encore/cmdutil
    
    the code of the file until where you have to start completion: package cmdutil

import (
	"context"
	"fmt"
	"net"
	"os"
	"os/exec"
	"path/filepath"
	"time"

	"github.com/golang/protobuf/ptypes/empty"
	"google.golang.org/genproto/googleapis/rpc/errdetails"
	"google.golang.org/grpc"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"

	"encr.dev/internal/version"
	"encr.dev/pkg/xos"
	daemonpb "encr.dev/proto/encore/daemon"
)

// ConnectDaemon sets up the Encore daemon i
    
func errInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
	err := invoker(ctx, method, req, reply, cc, opts...)
	if err != nil {
		if st, ok := status.FromError(err); ok {
			if st.Code() == codes.Unauthenticated {
				Fatal("not logged in: run 'encore auth login' first")
			}
			for _, detail := range st.Details() {
				switch t := detail.(type) {
				case *errdetails.PreconditionFailure:
					for _, violation := range t.Violations {
						if violation.Type == "INVALID_REFRESH_TOKEN" {
							Fatal("OAuth refresh token was invalid. Please run `encore auth login` again.")
						}
					}
				}
			}
		}
	}
	return err
}