1
0
mirror of https://github.com/square/okhttp.git synced 2025-07-31 05:04:26 +03:00

Introduce EventListener.requestFailed, responseFailed events

These replace requestBodyEnd() / responseBodyEnd() in some failure scenarios.
They may also be issued in cases where no event was published previously.
This commit is contained in:
Jesse Wilson
2019-02-23 18:38:47 -05:00
parent 03f4170e89
commit aac6c8da07
9 changed files with 115 additions and 12 deletions

View File

@ -124,6 +124,11 @@ public final class LoggingEventListener extends EventListener {
logWithTime("requestBodyEnd: byteCount=" + byteCount);
}
@Override
public void requestFailed(Call call, IOException ioe) {
logWithTime("requestFailed: " + ioe);
}
@Override
public void responseHeadersStart(Call call) {
logWithTime("responseHeadersStart");
@ -144,6 +149,11 @@ public final class LoggingEventListener extends EventListener {
logWithTime("responseBodyEnd: byteCount=" + byteCount);
}
@Override
public void responseFailed(Call call, IOException ioe) {
logWithTime("responseFailed: " + ioe);
}
@Override
public void callEnd(Call call) {
logWithTime("callEnd");