Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Log non-fatal errors encountered during a scan #3612

Merged
merged 4 commits into from
Nov 19, 2024

Conversation

mcastorina
Copy link
Collaborator

Description:

Non-fatal errors produced by a source during enumeration or chunking are recorded in the report, but we don't do anything with them. This PR logs them after the scan completes.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

Comment on lines +887 to +890
errMsgs := make([]string, len(errs))
for i := 0; i < len(errs); i++ {
errMsgs[i] = errs[i].Error()
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you stringify these yourself in a new slice instead of just logging them directly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it looked better stringified:

{"errors": ["error chunking dir \"/tmp/fake-dir/\": repository does not exist"]}

vs

{"errors": [{"error": "error chunking dir \"/tmp/fake-dir/\": repository does not exist"}]}

@mcastorina mcastorina merged commit 6a77b73 into main Nov 19, 2024
13 checks passed
@mcastorina mcastorina deleted the chore-print-non-fatal-errs branch November 19, 2024 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants