Skip to content

Commit

Permalink
Added exception inside generate_xml_transcript, which was throwing er…
Browse files Browse the repository at this point in the history
…ror on prod (#122)
  • Loading branch information
kjallen committed Jun 21, 2024
1 parent fe786c1 commit 83c9e8c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/models/oral_history_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -416,12 +416,16 @@ def self.find_or_new(id)
end

def self.generate_xml_transcript(url)
tmpl = Nokogiri::XSLT(File.read('public/convert.xslt'))
resp = Net::HTTP.get(URI(url))
begin
tmpl = Nokogiri::XSLT(File.read('public/convert.xslt'))
resp = Net::HTTP.get(URI(url))

document = Nokogiri::XML(resp)
document = Nokogiri::XML(resp)

tmpl.transform(document).to_xml
tmpl.transform(document).to_xml
rescue => exception
OralHistoryItem.index_logger.error("#{exception.message}\n#{exception.backtrace}")
end
end

def self.total_records(args = {})
Expand Down

0 comments on commit 83c9e8c

Please sign in to comment.