From d30e3027a2005f82e9fa04a0b9c32759654373f3 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Mon, 19 Feb 2024 09:18:37 +0100 Subject: [PATCH] fix(scanner): Catch a `DownloadException` instead of `IOException` The `downloadRecursively()` function rethrows `IOException` as `DownloadException`, so the latter needs to be catched here. Signed-off-by: Sebastian Schuberth --- scanner/src/main/kotlin/Scanner.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scanner/src/main/kotlin/Scanner.kt b/scanner/src/main/kotlin/Scanner.kt index 594d1543a319f..71b8bf2e4304b 100644 --- a/scanner/src/main/kotlin/Scanner.kt +++ b/scanner/src/main/kotlin/Scanner.kt @@ -20,7 +20,6 @@ package org.ossreviewtoolkit.scanner import java.io.File -import java.io.IOException import java.time.Instant import kotlin.time.measureTime @@ -705,7 +704,7 @@ class Scanner( try { dir = provenanceDownloader.downloadRecursively(nestedProvenance) archiver.archive(dir, nestedProvenance.root) - } catch (e: IOException) { + } catch (e: DownloadException) { controller.addIssue( pkg.id, Issue(