Skip to content

Commit

Permalink
fix(dos): Correctly get error body strings
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Jun 24, 2024
1 parent b11c32a commit f77a29f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions clients/dos/src/main/kotlin/DosClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
}
Expand All @@ -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
}
Expand Down Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down

0 comments on commit f77a29f

Please sign in to comment.