45 lines
1.7 KiB
Java
45 lines
1.7 KiB
Java
package com.discord.restapi.utils;
|
|
|
|
import androidx.browser.trusted.sharing.ShareTarget;
|
|
import d0.z.d.m;
|
|
import d0.z.d.o;
|
|
import java.io.IOException;
|
|
import java.util.concurrent.TimeoutException;
|
|
import kotlin.jvm.functions.Function1;
|
|
import okhttp3.Request;
|
|
import okhttp3.Response;
|
|
import retrofit2.HttpException;
|
|
/* compiled from: RetryWithDelay.kt */
|
|
public final class RetryWithDelay$restRetry$1 extends o implements Function1<Throwable, Boolean> {
|
|
public static final RetryWithDelay$restRetry$1 INSTANCE = new RetryWithDelay$restRetry$1();
|
|
|
|
public RetryWithDelay$restRetry$1() {
|
|
super(1);
|
|
}
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Boolean invoke(Throwable th) {
|
|
return Boolean.valueOf(invoke(th));
|
|
}
|
|
|
|
public final boolean invoke(Throwable th) {
|
|
Response response;
|
|
Request request;
|
|
String str;
|
|
m.checkNotNullParameter(th, "throwable");
|
|
if (th instanceof HttpException) {
|
|
HttpException httpException = (HttpException) th;
|
|
int a = httpException.a();
|
|
retrofit2.Response<?> response2 = httpException.i;
|
|
if (!(response2 == null || (response = response2.a) == null || (request = response.i) == null || (str = request.f2969c) == null || !(!m.areEqual(str, ShareTarget.METHOD_GET))) || a == 401 || a == 429 || a == 503 || a == 403 || a == 404) {
|
|
return false;
|
|
}
|
|
} else if (th instanceof TimeoutException) {
|
|
return false;
|
|
}
|
|
return th instanceof IOException;
|
|
}
|
|
}
|