diff --git a/lib/barsoom_utils/exception_notifier.rb b/lib/barsoom_utils/exception_notifier.rb index 41ebc90..ba28f35 100644 --- a/lib/barsoom_utils/exception_notifier.rb +++ b/lib/barsoom_utils/exception_notifier.rb @@ -37,14 +37,7 @@ def self.message(message, details_or_context = nil, context_or_nothing = nil) # Wrap this around code to add context when reporting errors. def self.run_with_context(context, &block) - # The load/dump achieves a "deep dup" without the "deep dep" of Active Support 🥁 - old_context = Marshal.load(Marshal.dump(Honeybadger.get_context)) - - Honeybadger.context(context) - block.call - ensure - Honeybadger.context.clear! - Honeybadger.context(old_context) + Honeybadger.context(context, &block) end end end