Skip to content

Commit

Permalink
Prøv å få logs ved 400
Browse files Browse the repository at this point in the history
  • Loading branch information
almyy committed Jan 11, 2025
1 parent 0e1ab5d commit d9ce045
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import org.springframework.http.ResponseEntity
import org.springframework.http.converter.HttpMessageNotReadableException
import org.springframework.web.bind.annotation.ControllerAdvice
import org.springframework.web.bind.annotation.ExceptionHandler
import org.springframework.web.bind.annotation.ResponseStatus
import org.springframework.web.context.request.WebRequest
import org.springframework.web.reactive.function.client.WebClientResponseException
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
Expand All @@ -26,13 +27,15 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExcep
class InnsynExceptionHandler(
@Value("\${innsyn.loginurl}") private val innsynLoginUrl: String,
) : ResponseEntityExceptionHandler() {

@ExceptionHandler(Throwable::class)
fun handleAll(e: Throwable): ResponseEntity<FrontendErrorMessage> {
log.error(e.message, e)
val error = FrontendErrorMessage(UNEXPECTED_ERROR, e.message)
return ResponseEntity(error, HttpStatus.INTERNAL_SERVER_ERROR)
}

@ResponseStatus(HttpStatus.BAD_REQUEST)
override fun handleHttpMessageNotReadable(
e: HttpMessageNotReadableException,
headers: HttpHeaders,
Expand Down

0 comments on commit d9ce045

Please sign in to comment.