scottiedog45
09/28/2019, 5:05 PMfun getInvoice(id: String) {
launchWithErrorHandling {
val invoice = repository.getInvoice(id)
_showSuccess.postValue(invoice)
}
}
Tash
09/29/2019, 10:26 PMViewModel
layer, it might be more helpful to catch “domain specific” exceptions. At the repository layer, if the specific exceptions are caught and remodeled as “domain specific” exceptions such as `NetworkError`/`InvalidInvoice`/`ErrorRetrievingInvoice` etc, then at the ViewModel
, you could catch those instead of a catch-all.streetsofboston
09/29/2019, 10:37 PMResult<E, T>
or Either<E, T>
as return types instead, where E is your error-type (sealed class hierarchy?) and T is the return type.