Skip to content

Commit

Permalink
fix: more verbose error in template cli
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdh committed Aug 6, 2024
1 parent 92d58aa commit d3f8ca4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cli/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit d3f8ca4

Please sign in to comment.