31 lines
1.3 KiB
Java
31 lines
1.3 KiB
Java
|
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)));
|
||
|
}
|
||
|
}
|