mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
lint/deep-exit: avoid log.Fatal (#3367)
* lint/deep-exit: don't fail on invalid alert * lint/deep-exit: kinesis_test.go * lint/deep-exit: watcher_test.go * lint/deep-exit: parsing_test.go * lint/deep-exit: client_test.go
This commit is contained in:
parent
2c95a24f69
commit
ecf34c2fa1
8 changed files with 87 additions and 126 deletions
|
@ -363,10 +363,7 @@ func NewAlert(leaky *Leaky, queue *types.Queue) (types.RuntimeAlert, error) {
|
|||
}
|
||||
|
||||
if err := newApiAlert.Validate(strfmt.Default); err != nil {
|
||||
log.Errorf("Generated alerts isn't valid")
|
||||
log.Errorf("->%s", spew.Sdump(newApiAlert))
|
||||
// XXX: deep-exit - note other errors returned from this function are not fatal
|
||||
log.Fatalf("error : %s", err)
|
||||
return runtimeAlert, fmt.Errorf("invalid generated alert: %w: %s", err, spew.Sdump(newApiAlert))
|
||||
}
|
||||
|
||||
runtimeAlert.APIAlerts = append(runtimeAlert.APIAlerts, newApiAlert)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue