74 lines
2.3 KiB
Java
74 lines
2.3 KiB
Java
package i0.e0.a;
|
|
|
|
import i0.x;
|
|
import j0.o.o;
|
|
import java.util.Objects;
|
|
import retrofit2.adapter.rxjava.HttpException;
|
|
import rx.Observable;
|
|
import rx.Subscriber;
|
|
import rx.exceptions.CompositeException;
|
|
import rx.exceptions.OnCompletedFailedException;
|
|
import rx.exceptions.OnErrorFailedException;
|
|
import rx.exceptions.OnErrorNotImplementedException;
|
|
/* compiled from: BodyOnSubscribe */
|
|
public final class a<T> implements Observable.a<T> {
|
|
public final Observable.a<x<T>> i;
|
|
|
|
/* compiled from: BodyOnSubscribe */
|
|
/* renamed from: i0.e0.a.a$a reason: collision with other inner class name */
|
|
public static class C0314a<R> extends Subscriber<x<R>> {
|
|
public final Subscriber<? super R> i;
|
|
public boolean j;
|
|
|
|
public C0314a(Subscriber<? super R> subscriber) {
|
|
super(subscriber);
|
|
this.i = subscriber;
|
|
}
|
|
|
|
@Override // j0.g
|
|
public void onCompleted() {
|
|
if (!this.j) {
|
|
this.i.onCompleted();
|
|
}
|
|
}
|
|
|
|
@Override // j0.g
|
|
public void onError(Throwable th) {
|
|
if (!this.j) {
|
|
this.i.onError(th);
|
|
return;
|
|
}
|
|
new AssertionError("This should never happen! Report as a Retrofit bug with the full stacktrace.").initCause(th);
|
|
Objects.requireNonNull(o.a.b());
|
|
}
|
|
|
|
@Override // j0.g
|
|
public void onNext(Object obj) {
|
|
x xVar = (x) obj;
|
|
if (xVar.a()) {
|
|
this.i.onNext(xVar.b);
|
|
return;
|
|
}
|
|
this.j = true;
|
|
HttpException httpException = new HttpException(xVar);
|
|
try {
|
|
this.i.onError(httpException);
|
|
} catch (OnCompletedFailedException | OnErrorFailedException | OnErrorNotImplementedException unused) {
|
|
Objects.requireNonNull(o.a.b());
|
|
} catch (Throwable th) {
|
|
c.q.a.k.a.a0(th);
|
|
new CompositeException(httpException, th);
|
|
Objects.requireNonNull(o.a.b());
|
|
}
|
|
}
|
|
}
|
|
|
|
public a(Observable.a<x<T>> aVar) {
|
|
this.i = aVar;
|
|
}
|
|
|
|
@Override // rx.functions.Action1
|
|
public void call(Object obj) {
|
|
this.i.call(new C0314a((Subscriber) obj));
|
|
}
|
|
}
|