Skip to content

Commit

Permalink
Bare returnerer null
Browse files Browse the repository at this point in the history
  • Loading branch information
sebassonav committed Dec 19, 2024
1 parent d4fa96c commit a7dd914
Showing 1 changed file with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import com.fasterxml.jackson.databind.JsonNode
import com.github.michaelbull.result.Ok
import com.github.michaelbull.result.andThen
import io.ktor.client.HttpClient
import io.ktor.client.call.DoubleReceiveException
import io.ktor.client.call.NoTransformationFoundException
import io.ktor.client.call.body
import io.ktor.client.request.accept
import io.ktor.client.request.bearerAuth
Expand Down Expand Up @@ -128,15 +126,7 @@ class DownstreamResourceClient(
Ok(response.body<String>())
} else {
logger.info("Mottok uhåndtert content-type: ${response.contentType()}")
try {
Ok(response.body<String>())
} catch (e: Exception) {
when (e) {
is NoTransformationFoundException -> Ok(null)
is DoubleReceiveException -> throw e
else -> throw e
}
}
Ok(null)
}
}

Expand Down

0 comments on commit a7dd914

Please sign in to comment.