diff --git a/scripts/update_oai-pmh.rb b/scripts/update_oai-pmh.rb
index e20a528c55627bb2b34c94ca4d924e7dae7ab673..9da1dca76a16df945678de20a453ee4e0e41c78c 100644
--- a/scripts/update_oai-pmh.rb
+++ b/scripts/update_oai-pmh.rb
@@ -346,7 +346,12 @@ def query_oai_pmh_endpoint(endpoint)
         return status, [], {}, 0, {}
     end
 
-    dc_prefix = metadata_prefix_of(endpoint, 'http://www.openarchives.org/OAI/2.0/oai_dc/')
+    begin
+        dc_prefix = metadata_prefix_of(endpoint, 'http://www.openarchives.org/OAI/2.0/oai_dc/')
+    rescue StandardError => e
+        print_with_time("Error: metadata_prefix_of failed: #{e.message}")
+        return "Error", [], {}, 0, {}
+    end
 
     set_names = list_sets(endpoint)