Skip to content

Commit 4b1cc4d

Browse files
committed
Testing other exception for handling "not found"
1 parent 105890c commit 4b1cc4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/kotlin/no/nav/klage/document/config/ProblemHandlingControllerAdvice.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ package no.nav.klage.document.config
33
import no.nav.klage.document.exceptions.MissingAccessException
44
import no.nav.klage.document.util.getLogger
55
import org.springframework.http.ResponseEntity
6+
import org.springframework.orm.jpa.JpaObjectRetrievalFailureException
67
import org.springframework.web.bind.annotation.ControllerAdvice
78
import org.springframework.web.bind.annotation.ExceptionHandler
89
import org.springframework.web.context.request.NativeWebRequest
910
import org.zalando.problem.Problem
1011
import org.zalando.problem.Status
1112
import org.zalando.problem.spring.web.advice.AdviceTrait
1213
import org.zalando.problem.spring.web.advice.ProblemHandling
13-
import javax.persistence.EntityNotFoundException
1414

1515
@ControllerAdvice
1616
class ProblemHandlingControllerAdvice : OurOwnExceptionAdviceTrait, ProblemHandling
@@ -24,7 +24,7 @@ interface OurOwnExceptionAdviceTrait : AdviceTrait {
2424

2525
@ExceptionHandler
2626
fun handleEntityNotFound(
27-
ex: EntityNotFoundException,
27+
ex: JpaObjectRetrievalFailureException,
2828
request: NativeWebRequest
2929
): ResponseEntity<Problem> =
3030
create(Status.NOT_FOUND, ex, request)

0 commit comments

Comments
 (0)