/** * Make an OAI-PMH request. Die if there is an error; return a SimpleXML object * on success. * * @param string $verb OAI-PMH verb to execute. * @param array $params GET parameters for ListRecords method. * * @return object SimpleXML-formatted response. */ protected function sendRequest($verb, $params = []) { $result = $this->communicator->request($verb, $params); // Detect errors and die if one is found: if ($result->error) { $attribs = $result->error->attributes(); throw new \Exception("OAI-PMH error -- code: {$attribs['code']}, " . "value: {$result->error}"); } return $result; }
/** * Make an OAI-PMH request. Die if there is an error; return a SimpleXML object * on success. * * @param string $verb OAI-PMH verb to execute. * @param array $params GET parameters for ListRecords method. * * @return object SimpleXML-formatted response. */ protected function sendRequest($verb, $params = []) { $response = $this->communicator->request($verb, $params); $this->checkResponseForErrors($response); return $response; }