YuNing's Thought

Home

❯

Notes

❯

Kotlin Exceptions

Kotlin Exceptions

Apr 24, 20251 min read

Precondition functionUse caseException thrown
require()Checks user input validityIllegalArgumentException
check()Checks object or variable state validityIllegalStateException
error()Indicates an illegal state or conditionIllegalStateException

Custom Exception

class MyException: Exception("My message")

Links

  • Exceptions | Kotlin Documentation
  • Kotlin Type

Graph View

  • Custom Exception
  • Links

Backlinks

  • Kotlin Type
  • Kotlin

Created with Quartz v4.5.2 © 2025

  • GitHub
  • Discord Community