containsParameter('peer')) { throw new MissingRpcArgumentException('peer'); } try { $address = PeerAddress::fromAddress($rpcRequest->getParameter('peer')); } catch(InvalidArgumentException $e) { throw new InvalidRpcArgumentException('peer', $e->getMessage()); } try { if(!ContactManager::isContact($request->getPeer(), $address)) { // Return empty response if the contact does not exist return $rpcRequest->produceResponse(); } $rpcRequest->produceResponse(ContactManager::getStandardContact($request->getPeer(), $address)); } catch(DatabaseOperationException $e) { throw new StandardRpcException('Failed to get contact', StandardError::INTERNAL_SERVER_ERROR, $e); } } }