From 9a8da248c04f47ff30db6da22b035894294499d3 Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Mon, 1 Dec 2025 16:06:48 +0100 Subject: fix: show error page (#207) This shows error page when trying to load unavailable resource.--- .../kotlin/dev/dnpm/etl/processor/web/ApplicationControllerAdvice.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/kotlin') diff --git a/src/main/kotlin/dev/dnpm/etl/processor/web/ApplicationControllerAdvice.kt b/src/main/kotlin/dev/dnpm/etl/processor/web/ApplicationControllerAdvice.kt index 0dec30e..e81b348 100644 --- a/src/main/kotlin/dev/dnpm/etl/processor/web/ApplicationControllerAdvice.kt +++ b/src/main/kotlin/dev/dnpm/etl/processor/web/ApplicationControllerAdvice.kt @@ -24,10 +24,11 @@ import org.springframework.http.HttpStatus 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.servlet.resource.NoResourceFoundException @ControllerAdvice class ApplicationControllerAdvice { - @ExceptionHandler(NotFoundException::class) + @ExceptionHandler(NotFoundException::class, NoResourceFoundException::class) @ResponseStatus(HttpStatus.NOT_FOUND) - fun handleNotFoundException(e: NotFoundException): String = "errors/404" + fun handleNotFoundException(e: Exception): String = "errors/404" } -- cgit v1.2.3