We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fc5a55 commit 130d103Copy full SHA for 130d103
src/main/kotlin/no/nav/api/syfo/SyfoClient.kt
@@ -6,6 +6,7 @@ import io.ktor.client.engine.okhttp.*
6
import io.ktor.client.request.*
7
import io.ktor.http.*
8
import kotlinx.serialization.Serializable
9
+import no.nav.plugins.WebStatusException
10
import no.nav.utils.*
11
12
class SyfoClient(
@@ -58,6 +59,7 @@ class SyfoClient(
58
59
when (response.status) {
60
HttpStatusCode.NoContent -> null
61
HttpStatusCode.OK -> response.body()
62
+ HttpStatusCode.Forbidden -> throw WebStatusException("Ikke tilgang til brukers syfoveileder", HttpStatusCode.Forbidden)
63
else -> error("Ukjent status code: ${response.status}")
64
}
65
0 commit comments