src/OaiPmh/Harvester.php
protected function checkResponseForErrors($result)
    {
        // Detect errors and die if one is found:
        if ($result->error) {
            $attribs = $result->error->attributes();

            // If this is a bad resumption token error and we're trying to
            // restore a prior state, we should clean up.
            if ($attribs['code'] == 'badResumptionToken'
                && $this->stateManager->loadState()
            ) {
                $this->stateManager->clearState();
                throw new \Exception(
                    "Token expired; removing last_state.txt. Please restart harvest."
                );
            }
            throw new \Exception(
                "OAI-PMH error -- code: {$attribs['code']}, " .
                "value: {$result->error}"
            );
        }
    }
protected function checkResponseForErrors($result)
    {
        // Detect errors and die if one is found:
        if ($result->error) {
            $attribs = $result->error->attributes();

            // If this is a bad resumption token error and we're trying to
            // restore a prior state, we should clean up.
            if ($attribs['code'] == 'badResumptionToken'
                && $this->stateManager->loadState()
            ) {
                $this->stateManager->clearState();
                throw new \Exception(
                    "Token expired; removing last_state.txt. Please restart harvest."
                );
            }
            throw new \Exception(
                "OAI-PMH error -- code: {$attribs['code']}, " .
                "value: {$result->error}"
            );
        }
    }
protected function checkResponseForErrors ( $ result ) { // Detect errors and die if one is found: if ( $ result -> error ) { $ attribs = $ result -> error -> attributes ( ) ; // If this is a bad resumption token error and we're trying to // restore a prior state, we should clean up. if ( $ attribs [ 'code' ] == 'badResumptionToken' && $ this -> stateManager -> loadState ( ) ) { $ this -> stateManager -> clearState ( ) ; throw new \ Exception ( "Token expired; removing last_state.txt. Please restart harvest." ) ; } throw new \ Exception ( "OAI-PMH error -- code: {$attribs['code']}, " . "value: {$result->error}" ) ; } }
Check an OAI-PMH response for errors that need to be handled.

@param object $result OAI-PMH response (SimpleXML object)

@return void

@throws \Exception
Check an OAI - PMH response for errors that need to be handled .