mirror of
https://github.com/square/okhttp.git
synced 2025-11-27 18:21:14 +03:00
update Logging Interceptor to log connection failures
This commit is contained in:
@@ -207,7 +207,13 @@ public final class HttpLoggingInterceptor implements Interceptor {
|
||||
}
|
||||
|
||||
long startNs = System.nanoTime();
|
||||
Response response = chain.proceed(request);
|
||||
Response response;
|
||||
try {
|
||||
response = chain.proceed(request);
|
||||
} catch (Exception e) {
|
||||
logger.log("<-- HTTP FAILED: " + e);
|
||||
throw e;
|
||||
}
|
||||
long tookMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNs);
|
||||
|
||||
ResponseBody responseBody = response.body();
|
||||
|
||||
Reference in New Issue
Block a user