The project consists of 3 parts: data ,presentation,domain In data, there is a repository that receives data and transforms it into an object for the domain and, in principle, it does not matter any further. So, how do you handle the error if the data did not come? How to handle errors in Rx in general? applied such

  @Override public Observable<AuthorizationModel> getPostById(String postId) { return restClient.getAutrorizationApi(postId) .map(this.authorizationEntityDataMapper::transform) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()); } 
  • one
    When subscribing to Observable , the onError Subscriber method will have errors - A. Shakhov
  • @ A.Shakhov I know how to properly handle it and throw it in layers before the view? - elik
  • I will not write here about pure architecture, I advise you to read fernandocejas.com/2014/09/03/architecting-android-the-clean-way and see the code of the demo project in the repository. But in any case, it is necessary to transfer Observable, and processing should be done in the presentation layer, so that your views can change their state depending on the display logic - A. Shakhov
  • @ A.Shakhov I twist the image should have a exception and no more, and processing errors should be in data - elik
  • @ A.Shakhov I read it and guides Google too) b - elik

0