lib/dwc-archive/classification_normalizer.rb in dwc-archive-0.7.15 vs lib/dwc-archive/classification_normalizer.rb in dwc-archive-0.7.16
- old
+ new
@@ -206,10 +206,15 @@
@error_names << {:data => taxon, :error => :deprecated_parent, :current_parent => nil}
end
end
return 'error' unless parent_cpid
if parent_cpid.empty?
- res = get_classification_path(@normalized_data[taxon.parent_id])
+ res = 'error'
+ begin
+ res = get_classification_path(@normalized_data[taxon.parent_id])
+ rescue SystemStackError
+ @error_names << {:data => taxon, :error => :too_deep_hierarchy, :current_parent => nil}
+ end
return res if res == 'error'
if @with_canonical_names
taxon.classification_path += @normalized_data[taxon.parent_id].classification_path + [taxon.current_name_canonical]
end
taxon.classification_path_id += @normalized_data[taxon.parent_id].classification_path_id + [taxon.id]