Skip to content

Commit

Permalink
client: Return errors instead of aborting the process
Browse files Browse the repository at this point in the history
Aborting from withing a library package...., should never have been committed!

Signed-off-by: Manuel Mendez <[email protected]>
  • Loading branch information
mmlb committed Apr 15, 2022
1 parent c428d9a commit 7567b90
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions client/main.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package client

import (
"log"

"github.com/packethost/pkg/env"
"github.com/pkg/errors"
"github.com/tinkerbell/tink/protos/hardware"
Expand Down Expand Up @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand Down

0 comments on commit 7567b90

Please sign in to comment.