Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

# CaPyCli - Clearing Automation Python Command Line Tool for SW360

## NEXT

* make `findsources` more resilient against SW360 issues.

## 2.5.1 (2024-10-16)

* fix: urls coming from granularity file are repository urls and not source code
Expand Down
19 changes: 17 additions & 2 deletions capycli/bom/findsources.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,22 @@ def find_sources(self, bom: Bom) -> Tuple[int, int]:
if self.verbose:
print(" No Source code URL available",
"try to find from sw360 component or releases")
source_url = self.find_source_url_on_release(component)
try:
source_url = self.find_source_url_on_release(component)
except SW360Error as swex:
if swex.response is None:
print_red(" Unknown error: " + swex.message)
elif swex.response.status_code == requests.codes['not_found']:
print(
Fore.LIGHTYELLOW_EX + " Release not found " + component.name +
", " + component.version + Style.RESET_ALL)
else:
print(Fore.LIGHTRED_EX + " Error retrieving release data: ")
print(" " + component.name + ", " + component.version)
print(" Status Code: " + str(swex.response.status_code))
if swex.message:
print(" Message: " + swex.message)
print(Style.RESET_ALL)

# then consider the package managers
if not source_url and language.lower() == "javascript":
Expand Down Expand Up @@ -619,7 +634,7 @@ def run(self, args: Any) -> None:
self.verbose = args.verbose
self.github_name = args.name
self.github_token = args.github_token
if not self.sw360_url:
if args.sw360_url:
self.sw360_url = args.sw360_url

if self.sw360_url:
Expand Down
Loading