CamilleBC
06/27/2019, 10:33 AMfun getData(): Data? -> catch all exceptions and return null
- fun getData(): Data -> throw exceptions depending on the situation and have the user of the library catch them
- fun getData(): Outcome<S: Success, F: Failure> -> create a custom class to wrap the result
I'm very much a beginner, and I have no clue what would be the best pratice.
Btw I'm using retrofit2 with kotlin's coroutines, so the REST requests might return exceptions.Matthias Druwe
06/27/2019, 10:44 AMCamilleBC
06/27/2019, 10:46 AMMatthias Druwe
06/27/2019, 10:47 AMPavlo Liapota
06/27/2019, 10:52 AMCamilleBC
06/27/2019, 10:53 AM