December 2017
Intermediate to advanced
322 pages
7h 3m
English
While developing applications, errors may occur. We have to handle those errors properly to make sure our applications perform seamlessly on the user's end. Take the following program as an example:
fun main(args: Array<String>) {
Observable.just(1,2,3,4,5)
.map { it/(3-it) }
.subscribe {
println("Received $it")
}
}
Here is the output:

As expected, the program threw an error and that is a bad thing if that occurs on the user end. So, let's take a look at how we can handle errors in a reactive way. RxKotlin provides us with a few operators for error handling, which we'll take a look at. We will use the previous ...
Read now
Unlock full access