From e35564e53399bd847ed52c4c7add1ff3f9e59964 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Fri, 24 Jul 2020 11:02:08 +0200 Subject: [PATCH] error reporting for citeproc formatting errors #590 --- config/initializers/mime_types.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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