We should include an unwrapped exception in the last else block.
|
Throwable unwrapped = GRpcRuntimeExceptionWrapper.unwrap(e); |
|
final Optional<HandlerMethod> handlerMethod = methodResolver.resolveMethodByThrowable(call.getMethodDescriptor().getServiceName(), unwrapped); |
|
if (handlerMethod.isPresent()) { |
|
handle(handlerMethod.get(), call, customizer, e, headers, unwrapped); |
|
} else if (unwrapped instanceof StatusRuntimeException || unwrapped instanceof StatusException) { |
|
Status status = unwrapped instanceof StatusRuntimeException ? |
|
((StatusRuntimeException) unwrapped).getStatus() : |
|
((StatusException) unwrapped).getStatus(); |
|
Metadata metadata = unwrapped instanceof StatusRuntimeException ? |
|
((StatusRuntimeException) unwrapped).getTrailers() : |
|
((StatusException) unwrapped).getTrailers(); |
|
log.warn("Closing call with {}", status); |
|
call.close(status, Optional.ofNullable(metadata).orElseGet(Metadata::new)); |
|
} else { |
|
log.warn("Closing call with {}", Status.INTERNAL); |
We should include an unwrapped exception in the last else block.
grpc-spring-boot-starter/grpc-spring-boot-starter/src/main/java/org/lognet/springboot/grpc/FailureHandlingSupport.java
Lines 34 to 48 in 15ea1b8