Skip to content

Log does not include error #409

@abdheshkumar

Description

@abdheshkumar

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions