From f77a29f91cd4c60e7a26588e3d48d980b733b396 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Mon, 24 Jun 2024 17:31:31 +0200 Subject: [PATCH] fix(dos): Correctly get error body strings Signed-off-by: Sebastian Schuberth --- clients/dos/src/main/kotlin/DosClient.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/clients/dos/src/main/kotlin/DosClient.kt b/clients/dos/src/main/kotlin/DosClient.kt index 17fb6e0ac8921..872b47bbf677b 100644 --- a/clients/dos/src/main/kotlin/DosClient.kt +++ b/clients/dos/src/main/kotlin/DosClient.kt @@ -48,7 +48,7 @@ class DosClient(private val service: DosService) { return if (response.isSuccessful && responseBody != null) { responseBody } else { - logger.error { "Error getting the package configuration for PURL $purl: ${response.errorBody()}" } + logger.error { "Error getting the package configuration for PURL $purl: ${response.errorBody()?.string()}" } null } @@ -90,7 +90,7 @@ class DosClient(private val service: DosService) { logger.info { "Successfully uploaded $file to S3." } true } else { - logger.error { "Failed to upload $file to S3: ${response.errorBody()}" } + logger.error { "Failed to upload $file to S3: ${response.errorBody()?.string()}" } false } } @@ -111,7 +111,7 @@ class DosClient(private val service: DosService) { return if (response.isSuccessful && responseBody != null) { responseBody } else { - logger.error { "Error adding a new scan job for $zipFileKey and $purls: ${response.errorBody()}" } + logger.error { "Error adding a new scan job for $zipFileKey and $purls: ${response.errorBody()?.string()}" } null } @@ -149,7 +149,7 @@ class DosClient(private val service: DosService) { responseBody } else { - logger.error { "Error getting scan results: ${response.errorBody()}" } + logger.error { "Error getting scan results: ${response.errorBody()?.string()}" } null } @@ -171,7 +171,7 @@ class DosClient(private val service: DosService) { return if (response.isSuccessful && responseBody != null) { responseBody } else { - logger.error { "Error getting the scan state for job $id: ${response.errorBody()}" } + logger.error { "Error getting the scan state for job $id: ${response.errorBody()?.string()}" } null }