Back to Intellij Community

Checked exceptions in Kotlin

plugins/devkit/devkit-core/resources/inspectionDescriptions/checkedExceptions.html

2025.3-rc-2540 B
Original Source

Checked exceptions in Kotlin

This inspection works only for methods annotated with com.intellij.openapi.ThrowsChecked.

The inspection tries to find cases when an annotated function is called, but the exception is not caught.

Differences from Java's checked exceptions:

  • This inspection produces warnings and doesn't break compilation.
  • By design, it's fine to suppress the exception.
  • The inspection should not try to prove in every case that some exception is not caught. It's supposed only to remind API users about exceptions.