flâneur — a map of the web's best reading

Exceptions | Kotlin Documentation

kotlinlang.org · 3,561 words · saved by 1 readers

Exceptions help your code run more predictably, even when runtime errors occur that could disrupt program execution. Kotlin treats all exceptions as unchecked by default. Unchecked exceptions simplify the exception handling process: you can catch exceptions, but you don't need to explicitly handle or declare them. Learn more about how Kotlin handles exceptions when interacting with Java, Swift, and Objective-C in the Exception interoperability with Java, Swift, and Objective-C section. Working with exceptions consists of two primary actions: Throwing exceptions: indicate when a problem occurs. Catching exceptions: handle the unexpected exception manually by resolving the issue or notifying the developer or application user. Exceptions are represented by subclasses of the Exception class, which is a subclass of the Throwable class. For more information about the hierarchy, see the Exception hierarchy section. Since Exception is an open class, you can create custom exceptions to suit you

Exception and error handling Exceptions help your code run more predictably, even when runtime errors occur that could disrupt program execution. Kotlin treats all exceptions as unchecked by default. Unchecked exceptions simplify the exception handling process: you can catch exceptions, but you don't need to explicitly handle or declare them. Learn more about how Kotlin handles exceptions when interacting with Java, Swift, and Objective-C in the Exception interoperability with Java, Swift, and Objective-C section. Working with exceptions consists of two primary actions: Throwing exceptions: in

Explore this link on the map →

related reading