Skip to content

Commit

Permalink
Return err instead of panic.
Browse files Browse the repository at this point in the history
  • Loading branch information
wongherlung committed Jan 30, 2018
1 parent 143df04 commit 862295c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions output/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,17 @@ func reportJUnitXML(w io.Writer, data *reportInfo) error {

raw, err := xml.MarshalIndent(junitXMLStruct, "", "\t")
if err != nil {
panic(err)
return err
}

xmlHeader := []byte("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
raw = append(xmlHeader, raw...)
_, err = w.Write(raw)
if err != nil {
panic(err)
return err
}

return err
return nil
}

func reportFromPlaintextTemplate(w io.Writer, reportTemplate string, data *reportInfo) error {
Expand Down

0 comments on commit 862295c

Please sign in to comment.