You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/docs/asciidoc/languages/kotlin.adoc
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -528,6 +528,16 @@ and https://github.com/spring-projects/spring-boot/issues/1254[`@ConfigurationPr
528
528
for more details.
529
529
530
530
531
+
=== Checked Exceptions
532
+
533
+
Java and https://kotlinlang.org/docs/reference/exceptions.html[Kotlin exception handling] are pretty close, with the main
534
+
difference being that Kotlin treats all exceptions as unchecked exceptions. However, when using proxied objects
535
+
(for example classes or methods annotated with `@Transactional`), checked exceptions thrown will be wrapped by default in
536
+
an `UndeclaredThrowableException`.
537
+
538
+
To get the original exception thrown like in Java, methods should be annotated with https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.jvm/-throws/index.html[`@Throws`]
539
+
to specify explicitly the checked exceptions thrown (for example `@Throws(IOException::class)`).
0 commit comments