what-the-bank/sources/com/google/android/libraries/places/internal/zzcr.java

31 lines
1.3 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.google.android.libraries.places.internal;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkError;
import com.android.volley.ParseError;
import com.android.volley.ServerError;
import com.android.volley.TimeoutError;
import com.android.volley.VolleyError;
import com.google.android.gms.common.api.ApiException;
import com.google.android.gms.common.api.Status;
import com.google.android.libraries.places.api.net.PlacesStatusCodes;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes2.dex */
public final class zzcr {
/* JADX INFO: Access modifiers changed from: package-private */
public static ApiException zza(VolleyError volleyError) {
int i;
if (volleyError instanceof NetworkError) {
i = 7;
} else if (volleyError instanceof TimeoutError) {
i = 15;
} else if ((volleyError instanceof ServerError) || (volleyError instanceof ParseError)) {
i = 8;
} else {
i = volleyError instanceof AuthFailureError ? PlacesStatusCodes.REQUEST_DENIED : 13;
}
return new ApiException(new Status(i, String.format("Unexpected server error (HTTP Code: %s. Message: %s.)", volleyError.e == null ? "N/A" : String.valueOf(volleyError.e.d), volleyError)));
}
}