summaryrefslogtreecommitdiff
path: root/src/main/kotlin
diff options
context:
space:
mode:
authorPaul-Christian Volkmer2025-12-01 16:06:48 +0100
committerGitHub2025-12-01 16:06:48 +0100
commit9a8da248c04f47ff30db6da22b035894294499d3 (patch)
tree3efdd2abfc56265d606a48bec9f170127d6b5f12 /src/main/kotlin
parentb85f5fe60e9c2809b513304c73a86200c91b1c2d (diff)
fix: show error page (#207)
This shows error page when trying to load unavailable resource.
Diffstat (limited to 'src/main/kotlin')
-rw-r--r--src/main/kotlin/dev/dnpm/etl/processor/web/ApplicationControllerAdvice.kt5
1 files changed, 3 insertions, 2 deletions
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"
}