Handling Error RXJava Android with Kotlin
Hi I'm new with RxJava and Kotlin and I loose some concepts about it. I have "api" like this: interface VehiclesService { @GET("/vehicles/") fun getVehicles(): Single<List<Vehicle>> } Then I create the retrofit client, etc.. like this: var retrofit = RetrofitClient().getInstance() vehiclesAPI = retrofit!!.create(VehiclesService ::class.java) finally I do the call: private fun fetchData() { compositeDisposable.add(vehiclesAPI .getVehicles() .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe { vehicles -> displayData(vehicles) } ) } And here is where I have the