Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,9 @@ public void onResponse(Void element) {

@Override
public void onFailure(Exception e) {
if (failure.compareAndSet(null, e) == false) {
failure.accumulateAndGet(e, (current, update) -> {
// we have to avoid self-suppression!
if (update != current) {
current.addSuppressed(update);
}
return current;
});
final var firstException = failure.compareAndExchange(null, e);
if (firstException != null && firstException != e) {
firstException.addSuppressed(e);
}
if (countDown()) {
super.onFailure(failure.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,9 @@ public void onResponse(T element) {

@Override
public void onFailure(Exception e) {
if (failure.compareAndSet(null, e) == false) {
failure.accumulateAndGet(e, (current, update) -> {
// we have to avoid self-suppression!
if (update != current) {
current.addSuppressed(update);
}
return current;
});
final var firstException = failure.compareAndExchange(null, e);
if (firstException != null && firstException != e) {
firstException.addSuppressed(e);
}
if (countDown.countDown()) {
super.onFailure(failure.get());
Expand Down