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