2021-11-02 06:38:17 +00:00
|
|
|
package i0;
|
2021-08-03 07:33:18 +00:00
|
|
|
|
2021-08-09 22:51:56 +00:00
|
|
|
import androidx.core.app.NotificationCompat;
|
2021-11-02 06:38:17 +00:00
|
|
|
import d0.k;
|
|
|
|
import d0.l;
|
2021-08-03 07:33:18 +00:00
|
|
|
import java.lang.reflect.Method;
|
|
|
|
import java.util.Objects;
|
|
|
|
import kotlin.KotlinNullPointerException;
|
|
|
|
import kotlinx.coroutines.CancellableContinuation;
|
2021-08-10 21:19:22 +00:00
|
|
|
import okhttp3.Request;
|
2021-08-03 07:33:18 +00:00
|
|
|
import retrofit2.HttpException;
|
|
|
|
import retrofit2.Response;
|
|
|
|
/* compiled from: KotlinExtensions.kt */
|
2022-03-07 09:34:54 +00:00
|
|
|
/* loaded from: classes3.dex */
|
2021-08-03 07:33:18 +00:00
|
|
|
public final class m implements f<T> {
|
|
|
|
public final /* synthetic */ CancellableContinuation a;
|
|
|
|
|
|
|
|
public m(CancellableContinuation cancellableContinuation) {
|
|
|
|
this.a = cancellableContinuation;
|
|
|
|
}
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
@Override // i0.f
|
2021-08-03 07:33:18 +00:00
|
|
|
public void a(d<T> dVar, Throwable th) {
|
2021-11-02 06:38:17 +00:00
|
|
|
d0.z.d.m.checkParameterIsNotNull(dVar, NotificationCompat.CATEGORY_CALL);
|
|
|
|
d0.z.d.m.checkParameterIsNotNull(th, "t");
|
2021-08-03 07:33:18 +00:00
|
|
|
CancellableContinuation cancellableContinuation = this.a;
|
2021-12-02 18:53:44 +00:00
|
|
|
k.a aVar = k.j;
|
2021-11-02 06:38:17 +00:00
|
|
|
cancellableContinuation.resumeWith(k.m72constructorimpl(l.createFailure(th)));
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
@Override // i0.f
|
2021-08-03 07:33:18 +00:00
|
|
|
public void b(d<T> dVar, Response<T> response) {
|
2021-11-02 06:38:17 +00:00
|
|
|
d0.z.d.m.checkParameterIsNotNull(dVar, NotificationCompat.CATEGORY_CALL);
|
|
|
|
d0.z.d.m.checkParameterIsNotNull(response, "response");
|
2021-08-03 07:33:18 +00:00
|
|
|
if (response.a()) {
|
2022-03-28 08:10:50 +00:00
|
|
|
T t = response.f3817b;
|
2021-08-03 07:33:18 +00:00
|
|
|
if (t == 0) {
|
2021-12-17 21:59:34 +00:00
|
|
|
Request c = dVar.c();
|
|
|
|
Objects.requireNonNull(c);
|
2021-11-02 06:38:17 +00:00
|
|
|
d0.z.d.m.checkParameterIsNotNull(k.class, "type");
|
2021-12-17 21:59:34 +00:00
|
|
|
Object cast = k.class.cast(c.f.get(k.class));
|
2021-08-03 07:33:18 +00:00
|
|
|
if (cast == null) {
|
2021-11-02 06:38:17 +00:00
|
|
|
d0.z.d.m.throwNpe();
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
2021-11-02 06:38:17 +00:00
|
|
|
d0.z.d.m.checkExpressionValueIsNotNull(cast, "call.request().tag(Invocation::class.java)!!");
|
2021-08-03 07:33:18 +00:00
|
|
|
Method method = ((k) cast).a;
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
sb.append("Response from ");
|
2021-11-02 06:38:17 +00:00
|
|
|
d0.z.d.m.checkExpressionValueIsNotNull(method, "method");
|
2021-08-03 07:33:18 +00:00
|
|
|
Class<?> declaringClass = method.getDeclaringClass();
|
2021-11-02 06:38:17 +00:00
|
|
|
d0.z.d.m.checkExpressionValueIsNotNull(declaringClass, "method.declaringClass");
|
2021-08-03 07:33:18 +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-02 18:53:44 +00:00
|
|
|
k.a aVar = k.j;
|
2021-11-02 06:38:17 +00:00
|
|
|
cancellableContinuation.resumeWith(k.m72constructorimpl(l.createFailure(kotlinNullPointerException)));
|
2021-08-03 07:33:18 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
CancellableContinuation cancellableContinuation2 = this.a;
|
2021-12-02 18:53:44 +00:00
|
|
|
k.a aVar2 = k.j;
|
2021-11-02 06:38:17 +00:00
|
|
|
cancellableContinuation2.resumeWith(k.m72constructorimpl(t));
|
2021-08-03 07:33:18 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
CancellableContinuation cancellableContinuation3 = this.a;
|
|
|
|
HttpException httpException = new HttpException(response);
|
2021-12-02 18:53:44 +00:00
|
|
|
k.a aVar3 = k.j;
|
2021-11-02 06:38:17 +00:00
|
|
|
cancellableContinuation3.resumeWith(k.m72constructorimpl(l.createFailure(httpException)));
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|