Fix DB driver auto-detection, root 404, and linting
- Removed hardcoded `driver-class-name` from `application.yaml` to fix production startup failure with PostgreSQL. - Handled `NoResourceFoundException` in `ApiExceptionHandler` to return 404 for unmapped paths (like `/`). - Fixed import ordering in `ApiExceptionHandler.kt` to satisfy `ktlint`. - Added `NotFoundControllerTest` to verify fix. Co-authored-by: devitq <118541411+devitq@users.noreply.github.com>
This commit is contained in:
co-authored by
devitq
parent
cc02ccac01
commit
09393a1bd0
@@ -11,8 +11,8 @@ import org.springframework.web.bind.MethodArgumentNotValidException
|
|||||||
import org.springframework.web.bind.annotation.ExceptionHandler
|
import org.springframework.web.bind.annotation.ExceptionHandler
|
||||||
import org.springframework.web.bind.annotation.ResponseStatus
|
import org.springframework.web.bind.annotation.ResponseStatus
|
||||||
import org.springframework.web.bind.annotation.RestControllerAdvice
|
import org.springframework.web.bind.annotation.RestControllerAdvice
|
||||||
import org.springframework.web.servlet.resource.NoResourceFoundException
|
|
||||||
import org.springframework.web.server.ResponseStatusException
|
import org.springframework.web.server.ResponseStatusException
|
||||||
|
import org.springframework.web.servlet.resource.NoResourceFoundException
|
||||||
|
|
||||||
@RestControllerAdvice
|
@RestControllerAdvice
|
||||||
class ApiExceptionHandler {
|
class ApiExceptionHandler {
|
||||||
|
|||||||
Reference in New Issue
Block a user