From 2ce373d678bec0a042d87b37bcbc5715381780fd Mon Sep 17 00:00:00 2001 From: Frank Viernau Date: Tue, 19 Sep 2023 11:24:29 +0200 Subject: [PATCH] chore(osv): Improve the failure case of `getVulnerabilitiesForIds()` Provide an exception message which tells for which exact identifier the vulnerability (details) could not be obtained. Signed-off-by: Frank Viernau --- clients/osv/src/main/kotlin/OsvService.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clients/osv/src/main/kotlin/OsvService.kt b/clients/osv/src/main/kotlin/OsvService.kt index 0508133798490..813937fe5a519 100644 --- a/clients/osv/src/main/kotlin/OsvService.kt +++ b/clients/osv/src/main/kotlin/OsvService.kt @@ -114,7 +114,8 @@ class OsvService(serverUrl: String? = null, httpClient: OkHttpClient? = null) { } override fun onFailure(call: Call, t: Throwable) { - failureThrowable.set(t) + val exception = IOException("Could not get vulnerability information for '$id'.", t) + failureThrowable.set(exception) latch.countDown() } })