require 'rails' require 'exception_notification' require 'whoopsie/engine' require 'whoopsie/railtie' module Whoopsie class << self def report_and_swallow yield rescue StandardError => e handle_exception(e) end def handle_exception(exception, data = {}) return ExceptionNotifier.notify_exception(exception, data) if Rails.application.config.whoopsie.enable fail(exception) end end end