title: Handling Error RXJava Android with Kotlin
body: <p>Hi I'm new with RxJava and Kotlin and I loose some concepts about it.</p>
  
  <p>I have "api" like this:</p>
  
  <pre><code>interface VehiclesService {
      @GET("/vehicles/")
      fun getVehicles(): Single&lt;List&lt;Vehicle&gt;&gt;
  }
  </code></pre>
  
  <p>Then I create the retrofit client, etc.. like this:</p>
  
  <pre><code>var retrofit = RetrofitClient().getInstance()
  vehiclesAPI = retrofit!!.create(VehiclesService ::class.java)
  </code></pre>
  
  <p>finally I do the call:</p>
  
  <pre><code>private fun fetchData() {
          compositeDisposable.add(vehiclesAPI .getVehicles()
                  .subscribeOn(Schedulers.io())
                  .observeOn(AndroidSchedulers.mainThread())
                  .subscribe { vehicles -&gt; displayData(vehicles) }
          )
      }
  </code></pre>
  
  <p>And here is where I have the error when I try to launch:</p>
  
  <pre><code>The exception was not handled due to missing onError handler in the subscribe() method call
  </code></pre>
  
  <p>I know that the error is quite explicit. So I know what is missing, but what I don't know is HOW to handle this error.</p>
  
  <p>I tried adding : <code>.doOnError { error -&gt; Log.d("MainClass",error.message) }</code> but still telling same error message.</p>