Skip to content

Spring AOP should not apply UndeclaredThrowableException to checked exceptions from Kotlin methods #23844

@ryandanielspmc

Description

@ryandanielspmc

Currently, when using Spring AOP with Kotlin, UndeclaredThrowableException is thrown when a method with advice throws a checked exception. There is a workaround in Kotlin in that you can add @Throws annotations to methods, but this is not really feasible as it would require annotating every method of every project, and methods in other libraries might not be under your control.

What would solve this problem would be to have an option in Spring to disable the throwing of UndeclaredThrowableException and simply throw the original exception.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions