1
0
mirror of https://github.com/apache/dubbo.git synced 2024-10-23 07:04:37 +08:00

fix tri stub exception (#12093)

* fix tri stub exception

* fix
This commit is contained in:
earthchen 2023-04-14 17:20:30 +08:00 committed by GitHub
parent d73aca8847
commit 129b4fa2fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,7 +34,11 @@ public class UnaryStubMethodHandler<T, R> implements StubMethodHandler<T, R> {
T request = (T) arguments[0];
CompletableFuture<R> future = new CompletableFuture<>();
StreamObserver<R> responseObserver = new FutureToObserverAdaptor<>(future);
func.accept(request, responseObserver);
try {
func.accept(request, responseObserver);
} catch (Throwable e) {
future.completeExceptionally(e);
}
return future;
}
}