private void doRequestDone(Request req) {
        SendContext ctx = (SendContext)req.getContext();
        String serviceName = ((RPCServiceAddress)ctx.recipient.getServiceAddress()).getServiceName();
        Reply reply;
        Error error = null;
        if (!req.checkReturnTypes(getReturnSpec())) {
            // Map all known JRT errors to the appropriate message bus error.
            reply = new EmptyReply();
            error = switch (req.errorCode()) {
                case com.yahoo.jrt.ErrorCode.TIMEOUT -> new Error(ErrorCode.TIMEOUT,
                        "A timeout occurred while waiting for '" + serviceName + "' (" +
                                ctx.timeout + " seconds expired); " + req.errorMessage());
                case com.yahoo.jrt.ErrorCode.CONNECTION -> new Error(ErrorCode.CONNECTION_ERROR,
                        "A connection error occurred for '" + serviceName + "'; " + req.errorMessage());
                default -> new Error(ErrorCode.NETWORK_ERROR,
                        "A network error occurred for '" + serviceName + "'; " + req.errorMessage());
            };
        } else {
            reply = createReply(req.returnValues(), serviceName, ctx.trace);
        }
        if (ctx.trace.shouldTrace(TraceLevel.SEND_RECEIVE)) {
            ctx.trace.trace(TraceLevel.SEND_RECEIVE,
                    "Reply (type " + reply.getType() + ") received at " + clientIdent + ".");
        }
        reply.getTrace().swap(ctx.trace);
        if (error != null) {
            reply.addError(error);
        }
        ctx.recipient.handleReply(reply);
    }
Implements the request adapter for method "mbus.send1/mbus.slime".

@author baldersheim
messagebus/src/main/java/com/yahoo/messagebus/network/rpc/RPCSend.java