containsParameter('peer')) { throw new MissingRpcArgumentException('peer'); } $peerAddress = PeerAddress::fromAddress($rpcRequest->getParameter('peer')); try { $peer = $request->getPeer(); return $rpcRequest->produceResponse(ContactManager::isContact($peer, $peerAddress)); } catch (DatabaseOperationException $e) { throw new StandardRpcException('Failed to check if the contact exists', StandardError::INTERNAL_SERVER_ERROR, $e); } } }