@@ -70,6 +70,13 @@ private ClientCalls() {}
7070 *
7171 * <p>If the provided {@code responseObserver} is an instance of {@link ClientResponseObserver},
7272 * {@code beforeStart()} will be called.
73+ *
74+ * <h3>Server errors</h3>
75+ * If the throwable sent to the server's outbound {@link StreamObserver}'s onError
76+ * is a {@link StatusException} or {@link StatusRuntimeException}, that status code will be
77+ * received by the {@link ClientCall}'s onClose, and UNKNOWN status code otherwise. Its
78+ * description will be encoded to the stream trailer, but the cause (which may contain server
79+ * application's information) will not.
7380 */
7481 public static <ReqT , RespT > void asyncUnaryCall (
7582 ClientCall <ReqT , RespT > call , ReqT req , StreamObserver <RespT > responseObserver ) {
@@ -84,6 +91,13 @@ public static <ReqT, RespT> void asyncUnaryCall(
8491 *
8592 * <p>If the provided {@code responseObserver} is an instance of {@link ClientResponseObserver},
8693 * {@code beforeStart()} will be called.
94+ *
95+ * <h3>Server errors</h3>
96+ * If the throwable sent to the server's outbound {@link StreamObserver}'s onError
97+ * is a {@link StatusException} or {@link StatusRuntimeException}, that status code will be
98+ * received by the {@link ClientCall}'s onClose, and UNKNOWN status code otherwise. Its
99+ * description will be encoded to the stream trailer, but the cause (which may contain server
100+ * application's information) will not.
87101 */
88102 public static <ReqT , RespT > void asyncServerStreamingCall (
89103 ClientCall <ReqT , RespT > call , ReqT req , StreamObserver <RespT > responseObserver ) {
@@ -100,12 +114,23 @@ public static <ReqT, RespT> void asyncServerStreamingCall(
100114 * {@code beforeStart()} will be called.
101115 *
102116 * @return request stream observer. It will extend {@link ClientCallStreamObserver}
117+ *
118+ * <h3>Client errors</h3>
103119 * onError called on the request stream observer will result in stream cancellation. The response
104120 * {@link StreamObserver} will be immediately notified of the cancellation with a
105- * {@link io.grpc.StatusRuntimeException}. The server's request stream observer will receive an
106- * onError callbackk from the gRPC server framework with a {@link io.grpc.StatusRuntimeException}
107- * for the cancellation. The actual exception passed by the client to onError is never actually
108- * transmitted to the server.
121+ * {@link io.grpc.StatusRuntimeException} with the exception passed to onError set as the cause
122+ * and the stream is considered closed. The server's request stream observer will receive an
123+ * onError callback with a {@link io.grpc.StatusRuntimeException} for the cancellation with the
124+ * message 'Client cancelled', and exception cause set to null because the actual exception
125+ * passed by the client to onError is never actually transmitted to the server and the server
126+ * just receives a RST_STREAM frame indicating cancellation by the client.
127+ *
128+ * <h3>Server errors</h3>
129+ * If the throwable sent to the server's outbound {@link StreamObserver}'s onError
130+ * is a {@link StatusException} or {@link StatusRuntimeException}, that status code will be
131+ * received by the {@link ClientCall}'s onClose, and UNKNOWN status code otherwise. Its
132+ * description will be encoded to the stream trailer, but the cause (which may contain server
133+ * application's information) will not.
109134 */
110135 public static <ReqT , RespT > StreamObserver <ReqT > asyncClientStreamingCall (
111136 ClientCall <ReqT , RespT > call ,
@@ -122,12 +147,23 @@ public static <ReqT, RespT> StreamObserver<ReqT> asyncClientStreamingCall(
122147 * {@code beforeStart()} will be called.
123148 *
124149 * @return request stream observer. It will extend {@link ClientCallStreamObserver}
150+ *
151+ * <h3>Client errors</h3>
125152 * onError called on the request stream observer will result in stream cancellation. The response
126153 * {@link StreamObserver} will be immediately notified of the cancellation with a
127- * {@link io.grpc.StatusRuntimeException}. The server's request stream observer will receive an
128- * onError callbackk from the gRPC server framework with a {@link io.grpc.StatusRuntimeException}
129- * for the cancellation. The actual exception passed by the client to onError is never actually
130- * transmitted to the server.
154+ * {@link io.grpc.StatusRuntimeException} with the exception passed to onError set as the cause
155+ * and the stream is considered closed. The server's request stream observer will receive an
156+ * onError callback with a {@link io.grpc.StatusRuntimeException} for the cancellation with the
157+ * message 'Client cancelled', and exception cause set to null because the actual exception
158+ * passed by the client to onError is never actually transmitted to the server and the server
159+ * just receives a RST_STREAM frame indicating cancellation by the client.
160+ *
161+ * <h3>Server errors</h3>
162+ * If the throwable sent to the server's outbound {@link StreamObserver}'s onError
163+ * is a {@link StatusException} or {@link StatusRuntimeException}, that status code will be
164+ * received by the {@link ClientCall}'s onClose, and UNKNOWN status code otherwise. Its
165+ * description will be encoded to the stream trailer, but the cause (which may contain server
166+ * application's information) will not.
131167 */
132168 public static <ReqT , RespT > StreamObserver <ReqT > asyncBidiStreamingCall (
133169 ClientCall <ReqT , RespT > call , StreamObserver <RespT > responseObserver ) {
0 commit comments