diff --git a/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/LDAPServerFilter.java b/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/LDAPServerFilter.java index a50834d747..8aea37dc7a 100644 --- a/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/LDAPServerFilter.java +++ b/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/LDAPServerFilter.java @@ -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; /** @@ -635,7 +636,7 @@ public void completed(Object result) { return newCompletable(new Completable.Emitter() { @Override public void subscribe(final Completable.Subscriber s) throws Exception { - promise.thenOnResult(new ResultHandler() { + promise.thenOnResult(new ResultHandler() { @Override public void handleResult(Boolean result) { s.onComplete(); @@ -643,7 +644,13 @@ public void handleResult(Boolean result) { }).thenOnException(new ExceptionHandler() { @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 @@ -653,6 +660,7 @@ public void handleRuntimeException(RuntimeException exception) { }); } }); + } } }