Skip to content

Commit

Permalink
error reporting for citeproc formatting errors #590
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Jul 24, 2020
1 parent 2dda0f7 commit e35564e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions config/initializers/mime_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@
o.locale = options[:locale] || "en-US"
o.citation
end.join("\n\n")
rescue TypeError => e
Rails.logger.error e.message
Rails.logger.error obj.inspect
rescue TypeError => exception
Raven.extra_context object: obj
Raven.capture_exception(exception)

"An error occurred."
rescue CSL::ParseError # unknown style and/or location
Array.wrap(obj).map do |o|
o.style = "apa"
Expand All @@ -56,9 +58,9 @@
else
obj.send(f)
end
rescue TypeError => e
Rails.logger.error e.message
Rails.logger.error obj.inspect
rescue TypeError => exception
Raven.extra_context object: obj
Raven.capture_exception(exception)
end
end

Expand Down

0 comments on commit e35564e

Please sign in to comment.