65 lines
3.1 KiB
Java
65 lines
3.1 KiB
Java
package com.discord.stores.utilities;
|
|
|
|
import com.discord.analytics.generated.traits.TrackNetworkMetadata;
|
|
import com.discord.analytics.generated.traits.TrackNetworkMetadataReceiver;
|
|
import com.discord.utilities.analytics.AnalyticsUtils;
|
|
import com.discord.utilities.features.GrowthTeamFeatures;
|
|
import java.net.UnknownHostException;
|
|
import kotlin.jvm.functions.Function1;
|
|
import okhttp3.Request;
|
|
import retrofit2.HttpException;
|
|
import retrofit2.Response;
|
|
import rx.functions.Action1;
|
|
/* compiled from: RestCallState.kt */
|
|
public final class RestCallStateKt$logNetworkAction$3<T> implements Action1<Throwable> {
|
|
public final /* synthetic */ Function1 $networkActionProvider;
|
|
public final /* synthetic */ AnalyticsUtils.Tracker $tracker;
|
|
|
|
public RestCallStateKt$logNetworkAction$3(Function1 function1, AnalyticsUtils.Tracker tracker) {
|
|
this.$networkActionProvider = function1;
|
|
this.$tracker = tracker;
|
|
}
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:28:0x0071 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:33:? A[ADDED_TO_REGION, RETURN, SYNTHETIC] */
|
|
public final void call(Throwable th) {
|
|
TrackNetworkMetadata trackNetworkMetadata;
|
|
TrackNetworkMetadataReceiver schema$default;
|
|
Request request;
|
|
if (GrowthTeamFeatures.INSTANCE.isNetworkActionLoggingEnabled()) {
|
|
if (th instanceof HttpException) {
|
|
HttpException httpException = (HttpException) th;
|
|
Response<?> response = httpException.i;
|
|
if (!(response == null || (request = RestCallStateKt.getRequest(response)) == null)) {
|
|
String str = request.b.l;
|
|
String str2 = request.f2969c;
|
|
Response<?> response2 = httpException.i;
|
|
Long valueOf = response2 != null ? Long.valueOf((long) response2.a.l) : null;
|
|
Response<?> response3 = httpException.i;
|
|
Long valueOf2 = response3 != null ? Long.valueOf((long) response3.a.l) : null;
|
|
Response<?> response4 = httpException.i;
|
|
String str3 = response4 != null ? response4.a.k : null;
|
|
if (str3 == null) {
|
|
str3 = "";
|
|
}
|
|
trackNetworkMetadata = new TrackNetworkMetadata(str, str2, valueOf, valueOf2, str3);
|
|
if (trackNetworkMetadata == null && (schema$default = RestCallStateKt.getSchema$default(this.$networkActionProvider, trackNetworkMetadata, null, 4, null)) != null) {
|
|
this.$tracker.track(schema$default);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
} else if (th instanceof UnknownHostException) {
|
|
trackNetworkMetadata = new TrackNetworkMetadata(null, null, null, null, ((UnknownHostException) th).getLocalizedMessage(), 15);
|
|
if (trackNetworkMetadata == null) {
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
trackNetworkMetadata = null;
|
|
if (trackNetworkMetadata == null) {
|
|
}
|
|
}
|
|
}
|
|
}
|