Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#317] sendUnsolicitedNotification can fail on client disconnect with OnErrorNotImplementedException #320

Merged
Merged
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 @@ -84,6 +84,7 @@
import com.forgerock.reactive.ReactiveHandler;
import com.forgerock.reactive.Stream;

import io.reactivex.exceptions.OnErrorNotImplementedException;
import io.reactivex.internal.util.BackpressureHelper;

/**
Expand Down Expand Up @@ -635,15 +636,21 @@ public void completed(Object result) {
return newCompletable(new Completable.Emitter() {
@Override
public void subscribe(final Completable.Subscriber s) throws Exception {
promise.thenOnResult(new ResultHandler<Boolean>() {
promise.thenOnResult(new ResultHandler<Boolean>() {
@Override
public void handleResult(Boolean result) {
s.onComplete();
}
}).thenOnException(new ExceptionHandler<Exception>() {
@Override
public void handleException(Exception exception) {
s.onError(exception);
try {
s.onError(exception);
} catch (Throwable t) {
if (!(t instanceof OnErrorNotImplementedException)) {
throw t;
}
}
}
}).thenOnRuntimeException(new RuntimeExceptionHandler() {
@Override
Expand All @@ -653,6 +660,7 @@ public void handleRuntimeException(RuntimeException exception) {
});
}
});

}
}
}
Loading