50 lines
1.4 KiB
Java
50 lines
1.4 KiB
Java
package com.ubtrobot.analytics;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class ReportException extends Exception {
|
|
private static final int CODE_INTERNAL_SERVER_ERROR = 2;
|
|
private static final int CODE_NETWORK_DISCONNECTED = 1;
|
|
private static final int CODE_TIMEOUT = 3;
|
|
private static final int CODE_UNAUTHORIZED = 4;
|
|
private final int code;
|
|
|
|
public static class Factory {
|
|
public static ReportException a(Throwable th) {
|
|
return new ReportException(2, "Can not connect the server or unauthorized key.", th);
|
|
}
|
|
|
|
public static ReportException b(Throwable th) {
|
|
return new ReportException(1, "Network disconnected.", th);
|
|
}
|
|
|
|
public static ReportException c(Throwable th) {
|
|
return new ReportException(3, "Report timeout.", th);
|
|
}
|
|
|
|
public static ReportException d(Throwable th) {
|
|
return new ReportException(4, "unauthorized key.", th);
|
|
}
|
|
}
|
|
|
|
public boolean causedByInternalServerError() {
|
|
return this.code == 2;
|
|
}
|
|
|
|
public boolean causedByNetworkDisconnected() {
|
|
return this.code == 1;
|
|
}
|
|
|
|
public boolean causedByTimeOut() {
|
|
return this.code == 3;
|
|
}
|
|
|
|
public boolean causedByUnauthorized() {
|
|
return this.code == 4;
|
|
}
|
|
|
|
private ReportException(int i, String str, Throwable th) {
|
|
super(str, th);
|
|
this.code = i;
|
|
}
|
|
}
|