From d3f8ca42cd8a2ad252d8937632261bce989cc6a9 Mon Sep 17 00:00:00 2001 From: Muhammad Abduh Date: Tue, 6 Aug 2024 15:34:31 +0700 Subject: [PATCH] fix: more verbose error in template cli --- cli/template.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cli/template.go b/cli/template.go index 685c4f73..749ceb4b 100644 --- a/cli/template.go +++ b/cli/template.go @@ -404,8 +404,7 @@ func uploadTemplateCmd(cmdxConfig *cmdx.Config) *cobra.Command { var yamlObject struct { Type string `yaml:"type"` } - err = yaml.Unmarshal(yamlFile, &yamlObject) - if err != nil { + if err = yaml.Unmarshal(yamlFile, &yamlObject); err != nil { return err } @@ -495,7 +494,7 @@ func UploadTemplate(client sirenv1beta1.SirenServiceClient, yamlFile []byte) (ui }) if err != nil { - return 0, fmt.Errorf("failed to update rule of ID: %d\tname: %s", associatedRule.Id, associatedRule.Name) + return 0, fmt.Errorf("failed to update rule of ID: %d\tname: %s\terror: %v", associatedRule.Id, associatedRule.Name, err) } fmt.Println("successfully updated rule of ID: ", associatedRule.Id, "\tname: ", associatedRule.Name) }