diff --git a/lib/iev/termbase/relaton_db.rb b/lib/iev/termbase/relaton_db.rb index f3dd357..09c8a95 100644 --- a/lib/iev/termbase/relaton_db.rb +++ b/lib/iev/termbase/relaton_db.rb @@ -20,6 +20,18 @@ def initialize # @param code [String] reference # @return [RelatonIso::IsoBibliongraphicItem] def fetch(code) + relaton_item = fetch!(code) + + if relaton_item.nil? + debug(:relaton, "Could not fetch authorative source '#{code}'.") + end + + relaton_item + end + + private + + def fetch!(code) retrying_on_failures do capture_output_streams do @db.fetch code @@ -27,8 +39,6 @@ def fetch(code) end end - private - def retrying_on_failures(attempts: 4) curr_attempt = 1