File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/main/kotlin/no/nav/tms/varsel/api Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import io.ktor.server.response.*
1818import io.ktor.server.routing.*
1919import io.github.oshai.kotlinlogging.KotlinLogging
2020import io.ktor.serialization.jackson.*
21+ import io.ktor.server.plugins.*
2122import no.nav.tms.common.metrics.installTmsMicrometerMetrics
2223import no.nav.tms.token.support.idporten.sidecar.LevelOfAssurance
2324import no.nav.tms.token.support.idporten.sidecar.idPorten
@@ -47,12 +48,18 @@ fun Application.varselApi(
4748 }
4849) {
4950 val securelog = KotlinLogging .logger(" secureLog" )
51+ val log = KotlinLogging .logger{}
5052
5153 install(DefaultHeaders )
52-
5354 authInstaller()
5455
5556 install(StatusPages ) {
57+ exception<BadRequestException > { call, cause ->
58+ log.error { " 400 bad request" }
59+ call.respond(
60+ HttpStatusCode .BadRequest
61+ )
62+ }
5663 exception<Throwable > { call, cause ->
5764 securelog.warn(cause) { " Kall til ${call.request.uri} feilet: ${cause.message} " }
5865 call.respond(HttpStatusCode .InternalServerError )
You can’t perform that action at this time.
0 commit comments