mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
simplify err.Error() to err when used in printf context (#1603)
This commit is contained in:
parent
3c6834fc18
commit
628d7be1d8
32 changed files with 90 additions and 90 deletions
|
@ -73,13 +73,13 @@ func (s *Splunk) Notify(ctx context.Context, notification *protobufs.Notificatio
|
|||
if resp.StatusCode != 200 {
|
||||
content, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return &protobufs.Empty{}, fmt.Errorf("got non 200 response and failed to read error %s", string(err.Error()))
|
||||
return &protobufs.Empty{}, fmt.Errorf("got non 200 response and failed to read error %s", err)
|
||||
}
|
||||
return &protobufs.Empty{}, fmt.Errorf("got non 200 response %s", string(content))
|
||||
}
|
||||
respData, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return &protobufs.Empty{}, fmt.Errorf("failed to read response body got error %s", string(err.Error()))
|
||||
return &protobufs.Empty{}, fmt.Errorf("failed to read response body got error %s", err)
|
||||
}
|
||||
logger.Debug(fmt.Sprintf("got response %s", string(respData)))
|
||||
return &protobufs.Empty{}, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue