Skip to content

Commit 1bc93f9

Browse files
committed
noe quickfix på errorhandling av bad request
1 parent c694954 commit 1bc93f9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/main/api/util/ErrorHandling.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ fun StatusPagesConfig.feilhåndtering(
7171
}
7272

7373
else -> {
74+
if(cause is BadRequestException){
75+
logger.warn("Bad request", cause)
76+
call.respond(HttpStatusCode.BadRequest, FeilRespons("Feil i mottatte data: ${rootCause.message}"))
77+
return@exception
78+
}
7479
logger.error("Uhåndtert feil ved kall mot ${call.request.path()}", cause)
7580
call.respond(
7681
HttpStatusCode.InternalServerError,

0 commit comments

Comments
 (0)