@@ -95,8 +95,9 @@ public <ReqT, RespT> CompletableFuture<Result<RespT>> unaryCall(
9595 logger .warn ("UnaryCall[{}] got unexprected status {}" , traceId , ex .getStatus ());
9696 return CompletableFuture .completedFuture (Result .fail (ex ));
9797 } catch (RuntimeException ex ) {
98- logger .warn ("UnaryCall[{}] got problem {}" , traceId , ex .getMessage ());
99- return CompletableFuture .completedFuture (Result .error (ex .getMessage (), ex ));
98+ String message = ex .getMessage () != null ? ex .getMessage () : ex .toString ();
99+ logger .warn ("UnaryCall[{}] got problem {}" , traceId , message );
100+ return CompletableFuture .completedFuture (Result .error (message , ex ));
100101 }
101102 }
102103
@@ -136,9 +137,10 @@ public <ReqT, RespT> GrpcReadStream<RespT> readStreamCall(
136137 logger .warn ("ReadStreamCall[{}] got unexpected status {}" , traceId , ex .getStatus ());
137138 return new EmptyStream <>(ex .getStatus ());
138139 } catch (RuntimeException ex ) {
139- logger .warn ("ReadStreamCall[{}] got problem {}" , traceId , ex .getMessage ());
140- Issue issue = Issue .of (ex .getMessage (), Issue .Severity .ERROR );
141- return new EmptyStream <>(Status .of (StatusCode .CLIENT_INTERNAL_ERROR , issue ));
140+ String message = ex .getMessage () != null ? ex .getMessage () : ex .toString ();
141+ logger .warn ("ReadStreamCall[{}] got problem {}" , traceId , message );
142+ Issue issue = Issue .of (message , Issue .Severity .ERROR );
143+ return new EmptyStream <>(Status .of (StatusCode .CLIENT_INTERNAL_ERROR , ex , issue ));
142144 }
143145 }
144146
@@ -180,9 +182,10 @@ traceId, call, makeMetadataFromSettings(settings), getAuthCallOptions(), handler
180182 logger .warn ("ReadWriteStreamCall[{}] got unexpected status {}" , traceId , ex .getStatus ());
181183 return new EmptyStream <>(ex .getStatus ());
182184 } catch (RuntimeException ex ) {
183- logger .warn ("ReadWriteStreamCall[{}] got problem {}" , traceId , ex .getMessage ());
184- Issue issue = Issue .of (ex .getMessage (), Issue .Severity .ERROR );
185- return new EmptyStream <>(Status .of (StatusCode .CLIENT_INTERNAL_ERROR , issue ));
185+ String message = ex .getMessage () != null ? ex .getMessage () : ex .toString ();
186+ logger .warn ("ReadWriteStreamCall[{}] got problem {}" , traceId , message );
187+ Issue issue = Issue .of (message , Issue .Severity .ERROR );
188+ return new EmptyStream <>(Status .of (StatusCode .CLIENT_INTERNAL_ERROR , ex , issue ));
186189 }
187190 }
188191
0 commit comments