From 130d103c1c9e8fb84f8fa3cca7658c3cb52ddb85 Mon Sep 17 00:00:00 2001 From: Ludvig Hozman Date: Wed, 26 Mar 2025 11:52:30 +0100 Subject: [PATCH] =?UTF-8?q?H=C3=A5ndter=20403=20fra=20syfo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/no/nav/api/syfo/SyfoClient.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/kotlin/no/nav/api/syfo/SyfoClient.kt b/src/main/kotlin/no/nav/api/syfo/SyfoClient.kt index bd24358..ca644aa 100644 --- a/src/main/kotlin/no/nav/api/syfo/SyfoClient.kt +++ b/src/main/kotlin/no/nav/api/syfo/SyfoClient.kt @@ -6,6 +6,7 @@ import io.ktor.client.engine.okhttp.* import io.ktor.client.request.* import io.ktor.http.* import kotlinx.serialization.Serializable +import no.nav.plugins.WebStatusException import no.nav.utils.* class SyfoClient( @@ -58,6 +59,7 @@ class SyfoClient( when (response.status) { HttpStatusCode.NoContent -> null HttpStatusCode.OK -> response.body() + HttpStatusCode.Forbidden -> throw WebStatusException("Ikke tilgang til brukers syfoveileder", HttpStatusCode.Forbidden) else -> error("Ukjent status code: ${response.status}") } }