@Test public void responseDoOnErrorDoesNotActivatesWhenSuccessfullyCompleted() { Requests.doOnError(response, (cause) -> completed.set(Optional.of(cause))) .consume(); publisher.next(new Buffer("content", UTF_8)); assertThat(completed.get(), is(nullValue())); publisher.complete(); assertThat(completed.get(), is(nullValue())); }
public static LiveHttpRequest doOnError(LiveHttpRequest request, Consumer<Throwable> action) { return request.newBuilder() .body(it -> it.doOnEnd(ifError(action))) .build(); }
Requests { public static LiveHttpRequest doOnError(LiveHttpRequest request, Consumer<Throwable> action) { return request.newBuilder() .body(it -> it.doOnEnd(ifError(action))) .build(); } }
Requests { public static LiveHttpRequest doOnError(LiveHttpRequest request, Consumer<Throwable> action) { return request.newBuilder() .body(it -> it.doOnEnd(ifError(action))) .build(); } private  Requests(); }
Requests { public static LiveHttpRequest doOnError(LiveHttpRequest request, Consumer<Throwable> action) { return request.newBuilder() .body(it -> it.doOnEnd(ifError(action))) .build(); } private  Requests(); static LiveHttpRequest doFinally(LiveHttpRequest request, Consumer<Optional<Throwable>> action); static LiveHttpResponse doFinally(LiveHttpResponse response, Consumer<Optional<Throwable>> action); static LiveHttpRequest doOnComplete(LiveHttpRequest request, Runnable action); static LiveHttpResponse doOnComplete(LiveHttpResponse response, Runnable action); static LiveHttpRequest doOnError(LiveHttpRequest request, Consumer<Throwable> action); static LiveHttpResponse doOnError(LiveHttpResponse response, Consumer<Throwable> action); static LiveHttpRequest doOnCancel(LiveHttpRequest request, Runnable action); static LiveHttpResponse doOnCancel(LiveHttpResponse response, Runnable action); }
Requests { public static LiveHttpRequest doOnError(LiveHttpRequest request, Consumer<Throwable> action) { return request.newBuilder() .body(it -> it.doOnEnd(ifError(action))) .build(); } private  Requests(); static LiveHttpRequest doFinally(LiveHttpRequest request, Consumer<Optional<Throwable>> action); static LiveHttpResponse doFinally(LiveHttpResponse response, Consumer<Optional<Throwable>> action); static LiveHttpRequest doOnComplete(LiveHttpRequest request, Runnable action); static LiveHttpResponse doOnComplete(LiveHttpResponse response, Runnable action); static LiveHttpRequest doOnError(LiveHttpRequest request, Consumer<Throwable> action); static LiveHttpResponse doOnError(LiveHttpResponse response, Consumer<Throwable> action); static LiveHttpRequest doOnCancel(LiveHttpRequest request, Runnable action); static LiveHttpResponse doOnCancel(LiveHttpResponse response, Runnable action);  }