Always print errors in EhEngine
This commit is contained in:
1 parent
fce659c41c
commit
7feb5552c1
1 file changed
+13
-1
@@ -92,7 +92,7 @@ public class EhEngine {
|
||||
sEhFilter = EhFilter.getInstance();
|
||||
}
|
||||
|
||||
private static void throwException(Call call, int code, @Nullable Headers headers,
|
||||
private static void doThrowException(Call call, int code, @Nullable Headers headers,
|
||||
@Nullable String body, Exception e) throws Exception {
|
||||
if (call.isCanceled()) {
|
||||
throw new CancelledException();
|
||||
@@ -119,6 +119,18 @@ public class EhEngine {
|
||||
if (code >= 400) {
|
||||
throw new StatusCodeException(code);
|
||||
}
|
||||
|
||||
throw e;
|
||||
}
|
||||
|
||||
private static void throwException(Call call, int code, @Nullable Headers headers,
|
||||
@Nullable String body, Exception e) throws Exception {
|
||||
try {
|
||||
doThrowException(call, code, headers, body, e);
|
||||
} catch (Throwable error) {
|
||||
error.printStackTrace();
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
public static String signIn(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
|
||||
|
||||
Reference in new issue
Block a user