Commit f8020b09d38a529f9f0ba29c8cbf08fab5ef1fef
1 parent
92747293
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
virtuoso: fix dspace harvest
Showing
1 changed file
with
6 additions
and
2 deletions
Show diff stats
plugins/virtuoso/lib/virtuoso_plugin/dspace_harvest.rb
| ... | ... | @@ -35,14 +35,18 @@ class VirtuosoPlugin::DspaceHarvest |
| 35 | 35 | def run |
| 36 | 36 | harvest_time = Time.now.utc |
| 37 | 37 | params = settings.last_harvest ? {:from => settings.last_harvest.utc} : {} |
| 38 | - puts "starting harvest #{params}" | |
| 38 | + puts "starting harvest #{params} #{settings.dspace_uri} #{settings.virtuoso_uri}" | |
| 39 | 39 | begin |
| 40 | 40 | records = dspace_client.list_records(params) |
| 41 | 41 | records.each do |record| |
| 42 | 42 | triplify(record) |
| 43 | 43 | end |
| 44 | - rescue Exception => ex | |
| 44 | + rescue OAI::Exception => ex | |
| 45 | 45 | puts ex.to_s |
| 46 | + if ex.code != 'noRecordsMatch' | |
| 47 | + puts "unexpected error" | |
| 48 | + raise ex | |
| 49 | + end | |
| 46 | 50 | end |
| 47 | 51 | settings.last_harvest = harvest_time |
| 48 | 52 | settings.save! | ... | ... |