Skip to content

Commit fc18037

Browse files
author
Ish Shah
committed
add error handling in command line
1 parent eaf20f5 commit fc18037

File tree

1 file changed

+5
-1
lines changed
  • internal/cmd/operator-sdk/scorecard

1 file changed

+5
-1
lines changed

internal/cmd/operator-sdk/scorecard/cmd.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ func (c *scorecardCmd) printOutput(output v1alpha3.TestList) error {
105105
}
106106
fmt.Printf("%s\n", string(bytes))
107107
case "xunit":
108-
bytes, err := xml.MarshalIndent(output, "", " ")
108+
xunitOutput, err := c.convertXunit(output)
109+
if err != nil {
110+
return fmt.Errorf("Xunit conversion error: %v", err)
111+
}
112+
bytes, err := xml.MarshalIndent(xunitOutput, "", " ")
109113
if err != nil {
110114
return fmt.Errorf("marshal xml error: %v", err)
111115
}

0 commit comments

Comments
 (0)