From 7567b90d5bcf1d6a47a9a462a0a355be7dbc6c39 Mon Sep 17 00:00:00 2001 From: Manuel Mendez Date: Thu, 7 Apr 2022 14:57:37 -0400 Subject: [PATCH] client: Return errors instead of aborting the process Aborting from withing a library package...., should never have been committed! Signed-off-by: Manuel Mendez --- client/main.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/client/main.go b/client/main.go index 1acf8b37e..9c8d27da6 100644 --- a/client/main.go +++ b/client/main.go @@ -1,8 +1,6 @@ package client import ( - "log" - "github.com/packethost/pkg/env" "github.com/pkg/errors" "github.com/tinkerbell/tink/protos/hardware" @@ -83,7 +81,7 @@ func Setup() error { func TinkHardwareClient() (hardware.HardwareServiceClient, error) { conn, err := GetConnection() if err != nil { - log.Fatal(err) + return nil, err } return hardware.NewHardwareServiceClient(conn), nil } @@ -92,7 +90,7 @@ func TinkHardwareClient() (hardware.HardwareServiceClient, error) { func TinkTemplateClient() (template.TemplateServiceClient, error) { conn, err := GetConnection() if err != nil { - log.Fatal(err) + return nil, err } return template.NewTemplateServiceClient(conn), nil } @@ -101,7 +99,7 @@ func TinkTemplateClient() (template.TemplateServiceClient, error) { func TinkWorkflowClient() (workflow.WorkflowServiceClient, error) { conn, err := GetConnection() if err != nil { - log.Fatal(err) + return nil, err } return workflow.NewWorkflowServiceClient(conn), nil }