-
Notifications
You must be signed in to change notification settings - Fork 308
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
ScanCode error handling improvements #9197
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9197 +/- ##
=========================================
Coverage 67.10% 67.10%
Complexity 1187 1187
=========================================
Files 240 240
Lines 7908 7908
Branches 914 914
=========================================
Hits 5307 5307
Misses 2233 2233
Partials 368 368
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
) | ||
} | ||
val summary = runCatching { | ||
scanner.scanPath(downloadDir, filteredContext) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit-message: Could you describe, why catching scanPath()
throws is now necessary and maybe outline a real world case where it throws?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why catching scanPath() throws is now necessary
It's not now necessary, but always was for proper handling of errors. I've clarified this in the commit message.
30d01f0
to
82096a1
Compare
82096a1
to
682fd2b
Compare
Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
There have reportedly [1] been cases where ScanCode apparently crashed without printing anything to `stderr`, resulting in no `result.json` file being written, which causes `readText()` to throw a `FileNotFoundException`. Properly handle such cases by logging and creating an issue for them. [1]: https://oss-review-toolkit.slack.com/archives/C9NNJ54B1/p1727277816661189?thread_ts=1724222709.453049 Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
682fd2b
to
ec04ed0
Compare
Please have a look at the individual commit messages for the details.