mirror of
https://github.com/apache/dubbo.git
synced 2024-10-23 07:04:37 +08:00
parent
d73aca8847
commit
129b4fa2fd
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user