android10 / Android-CleanArchitecture-Kotlin

This is a movies sample app in Kotlin, which is part of a serie of blog posts I have written about architecting android application using different approaches.
https://fernandocejas.com/2018/05/07/architecting-android-reloaded/
4.69k stars 935 forks source link

Unimplemented default error handling #2

Closed albodelu closed 7 years ago

albodelu commented 7 years ago

Default error handling was not implemented and I was waiting for your solution.

This is a possible way to manage it. Feel free to close it but I would appreciate your opinion.

I'm not sure if I am breaking SOLID principles but show loading and error message tasks are very related, and are repetitive tasks that I prefer to move to the base classes.

Now you can pass lambdas to the base disposable observer and add default error handling.

My app uses nullable views so I improvised a solution with lateinit a little strange for me.

Edit: I found this related article for Java: RxJava2 and Retrofit2 Error Handling on a single place

android10 commented 7 years ago

Thanks for the feedback @albodelu. I will close the ticket for now and will take that into consideration.