Closed xingye closed 4 years ago
Thanks for the contribution!
How about we create a custom operator in the ObservableType
extension like the following:
func orEmpty() -> Observable<Element> {
return catchError { _ in
return Observable.empty()
}
}
and use this operator in all the similar case?
Thanks for your reply. I have applied the error handling using ObservableType extension for all the image view bindings. Could you please help to review it?
If any of the image requests get an error response, it will crash since binding error. Catch error and return an empty observable or a placeholder image to avoid the crash.