Skip to content

Commit

Permalink
core/app/crash: Fix a crash in the crash handler
Browse files Browse the repository at this point in the history
If the crash report fails to send, we'd end up taking down the entire server.

As reported in #1580.
  • Loading branch information
ben-clayton committed Feb 13, 2018
1 parent 32473ae commit 2f5a49d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/app/crash/reporting/reporting.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ func (r Reporter) sendReport(body io.Reader, contentType, endpoint string) (stri

client := &http.Client{}
res, err := client.Do(req)
defer res.Body.Close()
if err == nil {
defer res.Body.Close()
}
if err != nil || res.StatusCode != http.StatusOK {
return "", fmt.Errorf("Failed to upload report request: %v (%v)", err, res.StatusCode)
}
Expand Down

0 comments on commit 2f5a49d

Please sign in to comment.