Skip to content

Commit 130d103

Browse files
committed
Håndter 403 fra syfo
1 parent 3fc5a55 commit 130d103

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/kotlin/no/nav/api/syfo/SyfoClient.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import io.ktor.client.engine.okhttp.*
66
import io.ktor.client.request.*
77
import io.ktor.http.*
88
import kotlinx.serialization.Serializable
9+
import no.nav.plugins.WebStatusException
910
import no.nav.utils.*
1011

1112
class SyfoClient(
@@ -58,6 +59,7 @@ class SyfoClient(
5859
when (response.status) {
5960
HttpStatusCode.NoContent -> null
6061
HttpStatusCode.OK -> response.body()
62+
HttpStatusCode.Forbidden -> throw WebStatusException("Ikke tilgang til brukers syfoveileder", HttpStatusCode.Forbidden)
6163
else -> error("Ukjent status code: ${response.status}")
6264
}
6365
}

0 commit comments

Comments
 (0)