Skip to content

Commit 0c1a52a

Browse files
authored
fix(malwareExecuteScan): add missing error handling (#4536)
1 parent e54d603 commit 0c1a52a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/malwarescan/malwarescan.go

+3
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ func (c *ClientImpl) sendAPIRequest(method, endpoint string, body io.Reader, hea
8181
// sendRequest results in any combination of nil and non-nil response and error.
8282
// a response body could even be already closed.
8383
response, err := c.HTTPClient.SendRequest(method, c.Host+endpoint, body, header, nil)
84+
if err != nil {
85+
return errors.Wrap(err, fmt.Sprintf("Failed to send request to MalwareService."))
86+
}
8487

8588
if response.StatusCode != 200 {
8689
var scanError ScanError

0 commit comments

Comments
 (0)