Sha256: c0bc58ff50f7a0396890f3f43465f3a86f51550366390996be4b4dc712363100

Contents?: true

Size: 584 Bytes

Versions: 1

Compression:

Stored size: 584 Bytes

Contents

# frozen_string_literal: true

module DispatchRider
  # This is the default error handler for dispatch rider.
  # It simply re-raises the exception.
  module DefaultErrorHandler
    def self.call(_message, exception)
      raise exception
    end
  end

  # This error handler integrates with airbrake.io, i
  # sending the mesage and environment details.
  module AirbrakeErrorHandler
    def self.call(message, exception)
      Airbrake.notify(exception, controller: "DispatchRider", action: message.subject, parameters: message.attributes, cgi_data: ENV.to_hash)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dispatch-rider-2.2.0 lib/dispatch-rider/error_handlers.rb