Read more

Exception notifier: How to provide custom data to fail mails

Emanuel
November 13, 2018Software engineer at makandra GmbH

The exception_notification Show archive.org snapshot gem supports to provide custom data to e.g. the fail mail within foreground or background jobs.

ExceptionNotifier.notify_exception(_ex_, :data => {:message => "was doing something wrong"})
Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

Still this can be blocked if you have an initializer where you override the default sections and background_sections option. So remember to add the data option to the desired section if required. In case you raise an exception without a data object, the fail mail still contains an empty data section.

require 'exception_notification/rails'

ExceptionNotification.configure do |config|

  config.add_notifier :email, {
    sections: %w[data request backtrace],
    background_sections: %w[data backtrace],
  }

end

Posted by Emanuel to makandra dev (2018-11-13 15:41)