From 131deab2cf292f1246109f5e2e2e14b35bdc3ca6 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 7 Apr 2022 10:38:22 +0200 Subject: [PATCH] improve runtime connect error messages --- ocis/pkg/command/kill.go | 2 +- ocis/pkg/command/list.go | 2 +- ocis/pkg/command/run.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ocis/pkg/command/kill.go b/ocis/pkg/command/kill.go index 853acdd715..03f2d52a36 100644 --- a/ocis/pkg/command/kill.go +++ b/ocis/pkg/command/kill.go @@ -35,7 +35,7 @@ func KillCommand(cfg *config.Config) *cli.Command { Action: func(c *cli.Context) error { client, err := rpc.DialHTTP("tcp", net.JoinHostPort(cfg.Runtime.Host, cfg.Runtime.Port)) if err != nil { - log.Fatal("dialing:", err) + log.Fatalf("Failed to connect to the runtime. Is the runtime running and did you configure the right runtime address (\"%s\")", cfg.Runtime.Host+":"+cfg.Runtime.Port) } var arg1 int diff --git a/ocis/pkg/command/list.go b/ocis/pkg/command/list.go index c7fd155871..a4223f4800 100644 --- a/ocis/pkg/command/list.go +++ b/ocis/pkg/command/list.go @@ -34,7 +34,7 @@ func ListCommand(cfg *config.Config) *cli.Command { Action: func(c *cli.Context) error { client, err := rpc.DialHTTP("tcp", net.JoinHostPort(cfg.Runtime.Host, cfg.Runtime.Port)) if err != nil { - log.Fatal("dialing:", err) + log.Fatalf("Failed to connect to the runtime. Is the runtime running and did you configure the right runtime address (\"%s\")", cfg.Runtime.Host+":"+cfg.Runtime.Port) } var arg1 string diff --git a/ocis/pkg/command/run.go b/ocis/pkg/command/run.go index 1cab47a0d3..d48da69338 100644 --- a/ocis/pkg/command/run.go +++ b/ocis/pkg/command/run.go @@ -36,7 +36,7 @@ func RunCommand(cfg *config.Config) *cli.Command { Action: func(c *cli.Context) error { client, err := rpc.DialHTTP("tcp", net.JoinHostPort(cfg.Runtime.Host, cfg.Runtime.Port)) if err != nil { - log.Fatal("dialing:", err) + log.Fatalf("Failed to connect to the runtime. Is the runtime running and did you configure the right runtime address (\"%s\")", cfg.Runtime.Host+":"+cfg.Runtime.Port) } var reply int