Skip to content

Commit

Permalink
Merge pull request #218 from navikt/bugfix/resource-not-found
Browse files Browse the repository at this point in the history
Return 404 on NoResourceFoundException
  • Loading branch information
enstulen authored Feb 14, 2024
2 parents b4a685c + 9224660 commit 547fa4f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler
import org.springframework.web.bind.annotation.ResponseStatus
import org.springframework.web.bind.annotation.RestControllerAdvice
import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException
import org.springframework.web.servlet.resource.NoResourceFoundException

@RestControllerAdvice
class ControllerAdvice {
Expand Down Expand Up @@ -105,7 +106,7 @@ class ControllerAdvice {
}

// 404
@ExceptionHandler(value = [ClientErrorNotFoundException::class])
@ExceptionHandler(value = [ClientErrorNotFoundException::class, NoResourceFoundException::class])
fun notFoundErrorResponse(
request: HttpServletRequest,
ex: ClientErrorNotFoundException
Expand Down

0 comments on commit 547fa4f

Please sign in to comment.