-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)theme: kotlinAn issue related to Kotlin supportAn issue related to Kotlin supporttype: regressionA bug that is also a regressionA bug that is also a regression
Milestone
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()
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)theme: kotlinAn issue related to Kotlin supportAn issue related to Kotlin supporttype: regressionA bug that is also a regressionA bug that is also a regression