diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index 796c84e23..960dd6f0c 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -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" @@ -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