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: add debug logging for decode errors #1352

Merged
merged 1 commit into from
Nov 21, 2022

Conversation

kzantow
Copy link
Contributor

@kzantow kzantow commented Nov 19, 2022

This PR adds debug logging for decode errors. If a file fails to decode, at least a user is now able to run syft -vv to see why all the formats failed, like this:

[0000] DEBUG format syft-6-json returned err: unable to decode: invalid character 'S' looking for beginning of value
[0000] DEBUG format cyclonedx-1-xml returned err: EOF
[0000] DEBUG format cyclonedx-1-json returned err: invalid character 'S' looking for beginning of value
[0000] DEBUG format spdx-2-tag-value returned err: unable to decode spdx-tag-value: got unknown checksum type sha256
[0000] DEBUG format spdx-2-json returned err: unable to decode spdx-json: invalid character 'S' looking for beginning of value
2022/11/19 09:34:55 error during command execution: failed to decode SBOM: unable to identify format

Provides a stop-gap solution for: #1351

Signed-off-by: Keith Zantow <kzantow@gmail.com>
@kzantow kzantow requested a review from a team November 19, 2022 15:17
@kzantow kzantow merged commit 0dddf51 into anchore:main Nov 21, 2022
@kzantow kzantow deleted the fix/log-decode-errors branch November 21, 2022 14:26
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants