Closed
Description
Hi.
while migrating from spring-boot 3.1.5 -> 3.2.0 all the Exception-handlers stopped working in our project. It turns out that functions can't be declared as kotlin extension functions anymore. Here's a code sample that works as expected for spring-boot-3.1.5 and not for spring-boot-3.2.0
class DemoApplication
fun main(args: Array<String>) {
runApplication<DemoApplication>(*args)
}
@RestController
class MyController{
@GetMapping("/test")
fun test() : String {throw CustomException()}
@ExceptionHandler(CustomException::class)
fun CustomException.handle(): ResponseEntity<Any>{
return ResponseEntity.status(HttpStatus.I_AM_A_TEAPOT.value()).build()
}
}
class CustomException : Throwable()