Thruway\Role\Dealer::processInvocationError PHP Method

processInvocationError() private method

Process InvocationError
private processInvocationError ( Session $session, Thruway\Message\ErrorMessage $msg )
$session Thruway\Session
$msg Thruway\Message\ErrorMessage
    private function processInvocationError(Session $session, ErrorMessage $msg)
    {
        //$call = $this->getCallByRequestId($msg->getRequestId());
        $call = $this->callInvocationIndex[$msg->getRequestId()];
        if (!$call) {
            $errorMsg = ErrorMessage::createErrorMessageFromMessage($msg);
            Logger::error($this, 'No call for invocation error message: ' . $msg->getRequestId());
            // TODO: do we send a message back to the callee?
            $errorMsg->setErrorURI('wamp.error.no_such_procedure');
            $session->sendMessage($errorMsg);
            return;
        }
        if ($call->getCalleeSession() !== $session) {
            Logger::error($this, "Attempted Invocation Error from session that does not own the call");
            return;
        }
        $call->getRegistration()->removeCall($call);
        $this->removeCall($call);
        $errorMsg = ErrorMessage::createErrorMessageFromMessage($call->getCallMessage());
        $errorMsg->setErrorURI($msg->getErrorURI());
        $errorMsg->setArguments($msg->getArguments());
        $errorMsg->setArgumentsKw($msg->getArgumentsKw());
        // not sure if this detail should pass through
        $errorMsg->setDetails($msg->getDetails());
        $call->getCallerSession()->sendMessage($errorMsg);
    }