Skip to content

Commit 922e499

Browse files
committed
Juster feillogging.
1 parent 29ad7d6 commit 922e499

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/main/kotlin/no/nav/tms/statistikk/login/loginApi.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ import io.ktor.server.routing.*
88

99
fun Route.loginApi(loginRepository: LoginRepository) {
1010
post("/innlogging") {
11-
12-
val login: Login = call.receive()
13-
loginRepository.registerLogin(login.ident)
14-
call.respond(HttpStatusCode.NoContent)
11+
val login: Login = call.receive()
12+
loginRepository.registerLogin(login.ident)
13+
call.respond(HttpStatusCode.NoContent)
1514
}
1615
}
1716

src/main/kotlin/no/nav/tms/statistikk/statistikkApi.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import io.github.oshai.kotlinlogging.KotlinLogging
1313
import no.nav.tms.statistikk.login.LoginRepository
1414
import no.nav.tms.statistikk.login.loginApi
1515
import no.nav.tms.token.support.azure.validation.azure
16+
import java.io.IOException
1617
import java.text.DateFormat
1718

1819
fun Application.statistikkApi(
@@ -32,6 +33,11 @@ fun Application.statistikkApi(
3233
securelog.warn(cause) { "Bad request til statistikkApi" }
3334
call.respond(HttpStatusCode.BadRequest, cause.message ?: "")
3435
}
36+
is IOException -> {
37+
log.warn { "IO-feil i statistikk-api" }
38+
securelog.warn(cause) { "IO-feil i statistikk-api" }
39+
call.respond(HttpStatusCode.InternalServerError)
40+
}
3541
else -> {
3642
log.error { "Feil i statistikkApi" }
3743
securelog.error(cause) { "Feil i statistikkApi" }

0 commit comments

Comments
 (0)