Posted 10 months ago. Visible to the public.

Exception notifier: How to provide custom data to fail mails

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

Copy
ExceptionNotifier.notify_exception(_ex_, :data => {:message => "was doing something wrong"})

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.

Copy
require 'exception_notification/rails' ExceptionNotification.configure do |config| config.add_notifier :email, { sections: %w[data request backtrace], background_sections: %w[data backtrace], } end

Once an application no longer requires constant development, it needs periodic maintenance for stable and secure operation. makandra offers monthly maintenance contracts that let you focus on your business while we make sure the lights stay on.

Owner of this card:

Avatar
Emanuel De
Last edit:
10 months ago
by Emanuel De
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Emanuel De to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more