Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Handle errors from rummager/router callbacks

On first attempt in preview, one of the Artefacts 404d, most likely
from the router. These changes mean that we will continue the import.
The artefact will have been saved anyway.
  • Loading branch information...
commit 2452635724cfbb85c574c626a081143021468562 1 parent 54e8071
@jamiecobbett jamiecobbett authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 lib/tasks/move_to_new_sections.rake
View
12 lib/tasks/move_to_new_sections.rake
@@ -6,7 +6,11 @@ module NewSectionMigration
def self.wipe_sections_from_artefacts
Artefact.all.each do |artefact|
artefact.sections = []
- artefact.save!
+ begin
+ artefact.save!
+ rescue StandardError => e
+ puts "Encountered error when saving artefact: #{artefact.slug}: #{e.to_s}. Sections stored in the database are now: #{artefact.reload.sections}"
+ end
end
end
@@ -86,7 +90,11 @@ module NewSectionMigration
end
end
a.sections = sections
- a.save!
+ begin
+ a.save!
+ rescue StandardError => e
+ puts "Encountered error when saving artefact: #{artefact.slug}: #{e.to_s}. Sections stored in the database are now: #{artefact.reload.sections}"
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.