added resilience for OAIPMH errors in the main loop