2021-11-08 18:25:28 +00:00
|
|
|
package i0;
|
2021-06-27 20:44:35 +00:00
|
|
|
|
2021-08-09 22:50:01 +00:00
|
|
|
import androidx.core.app.NotificationCompat;
|
2021-11-08 18:25:28 +00:00
|
|
|
import d0.k;
|
|
|
|
import d0.l;
|
2021-06-27 20:44:35 +00:00
|
|
|
import java.lang.reflect.Method;
|
|
|
|
import java.util.Objects;
|
|
|
|
import kotlin.KotlinNullPointerException;
|
|
|
|
import kotlinx.coroutines.CancellableContinuation;
|
2021-08-24 17:45:16 +00:00
|
|
|
import okhttp3.Request;
|
2021-06-27 20:44:35 +00:00
|
|
|
import retrofit2.HttpException;
|
2021-08-04 22:02:59 +00:00
|
|
|
import retrofit2.Response;
|
2021-06-27 20:44:35 +00:00
|
|
|
/* compiled from: KotlinExtensions.kt */
|
2022-03-02 20:59:20 +00:00
|
|
|
/* loaded from: classes3.dex */
|
2021-06-27 20:44:35 +00:00
|
|
|
public final class m implements f<T> {
|
|
|
|
public final /* synthetic */ CancellableContinuation a;
|
|
|
|
|
|
|
|
public m(CancellableContinuation cancellableContinuation) {
|
|
|
|
this.a = cancellableContinuation;
|
|
|
|
}
|
|
|
|
|
2021-11-08 18:25:28 +00:00
|
|
|
@Override // i0.f
|
2021-06-27 20:44:35 +00:00
|
|
|
public void a(d<T> dVar, Throwable th) {
|
2021-11-08 18:25:28 +00:00
|
|
|
d0.z.d.m.checkParameterIsNotNull(dVar, NotificationCompat.CATEGORY_CALL);
|
|
|
|
d0.z.d.m.checkParameterIsNotNull(th, "t");
|
2021-06-27 20:44:35 +00:00
|
|
|
CancellableContinuation cancellableContinuation = this.a;
|
2021-12-17 22:03:14 +00:00
|
|
|
k.a aVar = k.j;
|
2021-11-08 18:25:28 +00:00
|
|
|
cancellableContinuation.resumeWith(k.m72constructorimpl(l.createFailure(th)));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
2021-11-08 18:25:28 +00:00
|
|
|
@Override // i0.f
|
2021-08-04 22:02:59 +00:00
|
|
|
public void b(d<T> dVar, Response<T> response) {
|
2021-11-08 18:25:28 +00:00
|
|
|
d0.z.d.m.checkParameterIsNotNull(dVar, NotificationCompat.CATEGORY_CALL);
|
|
|
|
d0.z.d.m.checkParameterIsNotNull(response, "response");
|
2021-08-04 22:02:59 +00:00
|
|
|
if (response.a()) {
|
2022-03-30 16:43:10 +00:00
|
|
|
T t = response.f3806b;
|
2021-06-27 20:44:35 +00:00
|
|
|
if (t == 0) {
|
2021-12-21 23:37:30 +00:00
|
|
|
Request c = dVar.c();
|
|
|
|
Objects.requireNonNull(c);
|
2021-11-08 18:25:28 +00:00
|
|
|
d0.z.d.m.checkParameterIsNotNull(k.class, "type");
|
2021-12-21 23:37:30 +00:00
|
|
|
Object cast = k.class.cast(c.f.get(k.class));
|
2021-06-27 20:44:35 +00:00
|
|
|
if (cast == null) {
|
2021-11-08 18:25:28 +00:00
|
|
|
d0.z.d.m.throwNpe();
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
2021-11-08 18:25:28 +00:00
|
|
|
d0.z.d.m.checkExpressionValueIsNotNull(cast, "call.request().tag(Invocation::class.java)!!");
|
2021-06-27 20:44:35 +00:00
|
|
|
Method method = ((k) cast).a;
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
sb.append("Response from ");
|
2021-11-08 18:25:28 +00:00
|
|
|
d0.z.d.m.checkExpressionValueIsNotNull(method, "method");
|
2021-06-27 20:44:35 +00:00
|
|
|
Class<?> declaringClass = method.getDeclaringClass();
|
2021-11-08 18:25:28 +00:00
|
|
|
d0.z.d.m.checkExpressionValueIsNotNull(declaringClass, "method.declaringClass");
|
2021-06-27 20:44:35 +00:00
|
|
|
sb.append(declaringClass.getName());
|
|
|
|
sb.append('.');
|
|
|
|
sb.append(method.getName());
|
|
|
|
sb.append(" was null but response body type was declared as non-null");
|
|
|
|
KotlinNullPointerException kotlinNullPointerException = new KotlinNullPointerException(sb.toString());
|
|
|
|
CancellableContinuation cancellableContinuation = this.a;
|
2021-12-17 22:03:14 +00:00
|
|
|
k.a aVar = k.j;
|
2021-11-08 18:25:28 +00:00
|
|
|
cancellableContinuation.resumeWith(k.m72constructorimpl(l.createFailure(kotlinNullPointerException)));
|
2021-06-27 20:44:35 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
CancellableContinuation cancellableContinuation2 = this.a;
|
2021-12-17 22:03:14 +00:00
|
|
|
k.a aVar2 = k.j;
|
2021-11-08 18:25:28 +00:00
|
|
|
cancellableContinuation2.resumeWith(k.m72constructorimpl(t));
|
2021-06-27 20:44:35 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
CancellableContinuation cancellableContinuation3 = this.a;
|
2021-08-04 22:02:59 +00:00
|
|
|
HttpException httpException = new HttpException(response);
|
2021-12-17 22:03:14 +00:00
|
|
|
k.a aVar3 = k.j;
|
2021-11-08 18:25:28 +00:00
|
|
|
cancellableContinuation3.resumeWith(k.m72constructorimpl(l.createFailure(httpException)));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|