Skip to content

Commit 4f1b4d3

Browse files
committed
Error handling if pom url not found #1763
Signed-off-by: Chin Yeung Li <tli@nexb.com>
1 parent 9992d15 commit 4f1b4d3

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

scanpipe/pipes/maven.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,15 @@ def download_pom_files(pom_url_list):
189189
pom_file_list = []
190190
for pom_url in pom_url_list:
191191
pom_file_dict = {}
192-
downloaded_pom = fetch.fetch_http(pom_url)
193-
pom_file_dict["pom_file_path"] = str(downloaded_pom.path)
194-
pom_file_dict["output_path"] = str(downloaded_pom.path) + "-output.json"
195-
pom_file_dict["pom_url"] = pom_url
196-
pom_file_list.append(pom_file_dict)
192+
try:
193+
downloaded_pom = fetch.fetch_http(pom_url)
194+
pom_file_dict["pom_file_path"] = str(downloaded_pom.path)
195+
pom_file_dict["output_path"] = str(downloaded_pom.path) + "-output.json"
196+
pom_file_dict["pom_url"] = pom_url
197+
pom_file_list.append(pom_file_dict)
198+
except requests.RequestException:
199+
# Keep the process going if one pom_url fails
200+
continue
197201
return pom_file_list
198202

199203

0 commit comments

Comments
 (0)