@@ -95,8 +95,9 @@ public <ReqT, RespT> CompletableFuture<Result<RespT>> unaryCall(
95
95
logger .warn ("UnaryCall[{}] got unexprected status {}" , traceId , ex .getStatus ());
96
96
return CompletableFuture .completedFuture (Result .fail (ex ));
97
97
} 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 ));
100
101
}
101
102
}
102
103
@@ -136,9 +137,10 @@ public <ReqT, RespT> GrpcReadStream<RespT> readStreamCall(
136
137
logger .warn ("ReadStreamCall[{}] got unexpected status {}" , traceId , ex .getStatus ());
137
138
return new EmptyStream <>(ex .getStatus ());
138
139
} 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 ));
142
144
}
143
145
}
144
146
@@ -180,9 +182,10 @@ traceId, call, makeMetadataFromSettings(settings), getAuthCallOptions(), handler
180
182
logger .warn ("ReadWriteStreamCall[{}] got unexpected status {}" , traceId , ex .getStatus ());
181
183
return new EmptyStream <>(ex .getStatus ());
182
184
} 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 ));
186
189
}
187
190
}
188
191
0 commit comments