package retrofit2.adapter.rxjava3; import io.reactivex.rxjava3.exceptions.CompositeException; import o.AbstractC13163fSk; import o.C13147fSI; import o.C13418fZu; import o.InterfaceC13174fSv; import o.fSJ; import retrofit2.Response; /* loaded from: classes.dex */ final class ResultObservable extends AbstractC13163fSk> { private final AbstractC13163fSk> upstream; /* JADX INFO: Access modifiers changed from: package-private */ public ResultObservable(AbstractC13163fSk> abstractC13163fSk) { this.upstream = abstractC13163fSk; } @Override // o.AbstractC13163fSk public final void subscribeActual(InterfaceC13174fSv> interfaceC13174fSv) { this.upstream.subscribe(new ResultObserver(interfaceC13174fSv)); } /* loaded from: classes6.dex */ static class ResultObserver implements InterfaceC13174fSv> { private final InterfaceC13174fSv> observer; ResultObserver(InterfaceC13174fSv> interfaceC13174fSv) { this.observer = interfaceC13174fSv; } @Override // o.InterfaceC13174fSv public void onSubscribe(fSJ fsj) { this.observer.onSubscribe(fsj); } @Override // o.InterfaceC13174fSv public void onNext(Response response) { this.observer.onNext(Result.response(response)); } @Override // o.InterfaceC13174fSv public void onError(Throwable th) { try { this.observer.onNext(Result.error(th)); this.observer.onComplete(); } catch (Throwable th2) { try { this.observer.onError(th2); } catch (Throwable th3) { C13147fSI.c(th3); C13418fZu.c(new CompositeException(th2, th3)); } } } @Override // o.InterfaceC13174fSv public void onComplete() { this.observer.onComplete(); } } }