diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/kotlin/dev/dnpm/etl/processor/web/ApplicationControllerAdvice.kt | 5 | ||||
| -rw-r--r-- | src/main/resources/templates/errors/404.html | 3 |
2 files changed, 6 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" } diff --git a/src/main/resources/templates/errors/404.html b/src/main/resources/templates/errors/404.html index 530d030..713239d 100644 --- a/src/main/resources/templates/errors/404.html +++ b/src/main/resources/templates/errors/404.html @@ -9,6 +9,9 @@ <div th:replace="~{fragments.html :: nav}"></div> <main> <h1>Nichts gefunden</h1> + <p> + Die angeforderte Ressource oder Seite ist nicht vorhanden. + </p> </main> <footer th:replace="~{fragments.html :: footer}"></footer> </body> |
