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

Catch "diff" command panics within external library deps. and exit gracefully #80

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

mrutkows
Copy link
Contributor

@mrutkows mrutkows commented Apr 5, 2024

Attempted to provide some partial relief to the issue: #74
... despite not being able to submit a fix to the upstream library where the panic occurs.

Diff panics now exit with something that llke:

Welcome to the sbom-utility! Version `latest` (sbom-utility) (darwin/arm64)
===========================================================================
[INFO] Loading (embedded) default schema config file: `config.json`...
[INFO] Loading (embedded) default license policy file: `license.json`...
[INFO] Reading file (--input-file): `nats-box-49.sbom.json` ...
[INFO] Reading file (--input-revision): `nats-box-50.sbom.json` ...
[INFO] Comparing files: `nats-box-49.sbom.json` (base) to `nats-box-50.sbom.json` (revised) ...
panic occurred: runtime error: slice bounds out of range [2004:1743]
[ERROR] panic occurred: runtime error: slice bounds out of range [2004:1743]
[ERROR] diff failed: differences between files perhaps too large.

@mrutkows mrutkows added the enhancement New feature or request label Apr 5, 2024
@mrutkows mrutkows self-assigned this Apr 5, 2024
@mrutkows mrutkows merged commit d8ec3b9 into main Apr 5, 2024
6 checks passed
@mrutkows mrutkows deleted the diff-seg branch April 5, 2024 19:51
@mrutkows
Copy link
Contributor Author

mrutkows commented Apr 5, 2024

In addition, the exit code is now 1 (app. error) in these cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant