Sha256: 670d3c216d0aa72208665562b507081f412e9408ecf0f225e50129f03536ab33
Contents?: true
Size: 1003 Bytes
Versions: 10
Compression:
Stored size: 1003 Bytes
Contents
require 'mailman' module Bugsnag ## # Extracts and appends mailman message information to error reports class Mailman FRAMEWORK_ATTRIBUTES = { :framework => "Mailman" } def initialize Bugsnag.configuration.internal_middleware.use(Bugsnag::Middleware::Mailman) Bugsnag.configuration.app_type = "mailman" end ## # Calls the mailman middleware. def call(mail) begin Bugsnag.configuration.set_request_data :mailman_msg, mail.to_s yield rescue Exception => ex Bugsnag.notify(ex, true) do |report| report.severity = "error" report.severity_reason = { :type => Bugsnag::Report::UNHANDLED_EXCEPTION_MIDDLEWARE, :attributes => FRAMEWORK_ATTRIBUTES } end raise ensure Bugsnag.configuration.clear_request_data end end end end if Mailman.config.respond_to?(:middleware) Mailman.config.middleware.add ::Bugsnag::Mailman end
Version data entries
10 entries across 10 versions & 1 rubygems