Skip to content

Find, verify, and analyze leaked credentials

update error messages (#3490)

ahrav0b64fa0805a6
diff --git a/pkg/handlers/archive.go b/pkg/handlers/archive.go
index f5777fa52..98e31ba84 100644
--- a/pkg/handlers/archive.go
+++ b/pkg/handlers/archive.go
@@ -127,7 +127,11 @@ func (h *archiveHandler) openArchive(ctx logContext.Context, depth int, reader f
ctx.Logger().V(5).Info("empty reader, skipping file")
return nil
}
- return fmt.Errorf("error creating custom reader: %w", err)
+ return fmt.Errorf(
+ "error creating reader for decompressor with format: %s %w",
+ reader.format.Name(),
+ err,
+ )
}
defer rdr.Close()
@@ -211,7 +215,7 @@ func (h *archiveHandler) extractorHandler(archiveChan chan []byte) func(context.
lCtx.Logger().V(5).Info("empty reader, skipping file")
return nil
}
- return fmt.Errorf("error creating custom reader: %w", err)
+ return fmt.Errorf("error creating reader for file %s: %w", file.Name(), err)
}
defer rdr.Close()
diff --git a/pkg/handlers/handlers.go b/pkg/handlers/handlers.go
index 1561d826d..1b91a5ec2 100644
--- a/pkg/handlers/handlers.go
+++ b/pkg/handlers/handlers.go
@@ -281,7 +281,7 @@ func HandleFile(
ctx.Logger().V(5).Info("empty reader, skipping file")
return nil
}
- return fmt.Errorf("error creating custom reader: %w", err)
+ return fmt.Errorf("failed to create file reader to handle file: %w", err)
}
defer func() {
// Ensure all data is read to prevent broken pipe.