From 04e34372d60a6b0cdb7c7334e26beac45119fd94 Mon Sep 17 00:00:00 2001 From: liaozan <378024053@qq.com> Date: Thu, 25 Jan 2024 12:09:37 +0800 Subject: [PATCH] Return 404 when not found --- .../schbrain/common/web/exception/GlobalExceptionHandler.java | 1 + 1 file changed, 1 insertion(+) diff --git a/commons/web-common/src/main/java/com/schbrain/common/web/exception/GlobalExceptionHandler.java b/commons/web-common/src/main/java/com/schbrain/common/web/exception/GlobalExceptionHandler.java index 09df3e7..42f7204 100644 --- a/commons/web-common/src/main/java/com/schbrain/common/web/exception/GlobalExceptionHandler.java +++ b/commons/web-common/src/main/java/com/schbrain/common/web/exception/GlobalExceptionHandler.java @@ -72,6 +72,7 @@ public class GlobalExceptionHandler { return loggingThenBuildResponse(ex, SERVER_ERROR); } + @ResponseStatus(HttpStatus.NOT_FOUND) @ExceptionHandler(NoHandlerFoundException.class) public Object handleNoHandlerFoundException(NoHandlerFoundException ex) { return loggingThenBuildResponse(ex, PARAM_INVALID); -- GitLab