Skip to content

Commit

Permalink
[chore] - log detector type on error (#3159)
Browse files Browse the repository at this point in the history
* log detector type on error

* update error message

* update log

* update message
  • Loading branch information
ahrav authored Aug 2, 2024
1 parent ddb7211 commit 2961322
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkg/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -883,9 +883,10 @@ func (e *Engine) verificationOverlapWorker(ctx context.Context) {
matchedBytes := detector.Matches()
for _, match := range matchedBytes {
results, err := detector.FromData(ctx, false, match)
if err != nil {
ctx.Logger().Error(err, "error verifying chunk")
}
ctx.Logger().Error(
err, "error finding results in chunk during verification overlap",
"detector", detector.Key.Type().String(),
)

if len(results) == 0 {
continue
Expand Down Expand Up @@ -997,7 +998,10 @@ func (e *Engine) detectChunk(ctx context.Context, data detectableChunk) {
detectBytesPerMatch.Observe(float64(len(matchBytes)))
results, err := data.detector.Detector.FromData(ctx, data.chunk.Verify, matchBytes)
if err != nil {
ctx.Logger().Error(err, "error scanning chunk")
ctx.Logger().Error(
err, "error finding results in chunk",
"detector", data.detector.Key.Type().String(),
)
continue
}

Expand Down

0 comments on commit 2961322

Please sign in to comment.