From 467ff105db34c7e2bd028d35dff18a08df599a4c Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sat, 15 Oct 2022 09:08:13 +0200 Subject: [PATCH] fix(go-client): improve go-client error handling --- go-client/windmill.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/go-client/windmill.go b/go-client/windmill.go index 595ec571c5..a3c180f3a2 100644 --- a/go-client/windmill.go +++ b/go-client/windmill.go @@ -43,9 +43,12 @@ func GetVariable(path string) string { if err != nil { panic(err) } - res, _ := client.Client.GetVariableWithResponse(context.Background(), client.Workspace, path, &api.GetVariableParams{ + res, err := client.Client.GetVariableWithResponse(context.Background(), client.Workspace, path, &api.GetVariableParams{ DecryptSecret: newBool(true), }) + if err != nil { + panic(err) + } return *res.JSON200.Value } @@ -54,6 +57,9 @@ func GetResource(path string) map[string]interface{} { if err != nil { panic(err) } - res, _ := client.Client.GetResourceWithResponse(context.Background(), client.Workspace, path) + res, err := client.Client.GetResourceWithResponse(context.Background(), client.Workspace, path) + if err != nil { + panic(err) + } return *res.JSON200.Value }