protected Metadata resolveMetadata(final Object mappedReturnType) {
        Metadata result = null;
        if (mappedReturnType instanceof StatusException) {
            final StatusException statusException = (StatusException) mappedReturnType;
            result = statusException.getTrailers();
        } else if (mappedReturnType instanceof StatusRuntimeException) {
            final StatusRuntimeException statusException = (StatusRuntimeException) mappedReturnType;
            result = statusException.getTrailers();
        }
        return (result == null) ? new Metadata() : result;
    }
Creates a new {@link GrpcAdvice} powered {@link GrpcExceptionHandler}.

@param grpcExceptionHandlerMethodResolver The method resolver to use.
grpc-server-spring-boot-starter/src/main/java/net/devh/boot/grpc/server/advice/GrpcAdviceExceptionHandler.java