Skip to content

Commit 792fa17

Browse files
authored
release: 1.2.6 (#136)
2 parents 2c9e1dc + c0f71e7 commit 792fa17

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/kotlin/org/gitanimals/core/advice/GlobalExceptionHandler.kt

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import org.springframework.web.bind.MissingRequestHeaderException
88
import org.springframework.web.bind.annotation.ExceptionHandler
99
import org.springframework.web.bind.annotation.ResponseStatus
1010
import org.springframework.web.bind.annotation.RestControllerAdvice
11-
import java.lang.Exception
11+
import org.springframework.web.servlet.resource.NoResourceFoundException
1212

1313
@RestControllerAdvice
1414
class GlobalExceptionHandler {
@@ -45,4 +45,9 @@ class GlobalExceptionHandler {
4545
logger.error(exception.message, exception)
4646
return ErrorResponse("UN HANDLED EXCEPTION")
4747
}
48+
49+
@ExceptionHandler(NoResourceFoundException::class)
50+
@ResponseStatus(HttpStatus.NOT_FOUND)
51+
fun handleNoResourceFoundException(noResourceFoundException: NoResourceFoundException): ErrorResponse =
52+
ErrorResponse("NOT FOUND")
4853
}

0 commit comments

Comments
 (0)