lib/nanoc/base/store.rb in nanoc-3.6.8 vs lib/nanoc/base/store.rb in nanoc-3.6.9
- old
+ new
@@ -71,20 +71,25 @@
no_data_found
@loaded = true
return
end
- pstore.transaction do
- # Check version
- if pstore[:version] != version
- version_mismatch_detected
+ begin
+ pstore.transaction do
+ # Check version
+ if pstore[:version] != version
+ version_mismatch_detected
+ @loaded = true
+ return
+ end
+
+ # Load
+ self.data = pstore[:data]
@loaded = true
- return
end
-
- # Load
- self.data = pstore[:data]
- @loaded = true
+ rescue
+ FileUtils.rm_f(filename)
+ load
end
end
# Undoes the effects of {#load}. Used when {#load} raises an exception.
#