Sha256: 2fa38f3d1fe484624e040897896920d4ca8bd822ec6cab787f400cdceb0136e9
Contents?: true
Size: 1.47 KB
Versions: 21
Compression:
Stored size: 1.47 KB
Contents
module Airbrake module Rails # Contains helper methods that can be used inside Rails controllers to send # notices to Airbrake. The main benefit of using them instead of the direct # API is that they automatically add information from the Rack environment # to notices. module ActionController private # A helper method for sending notices to Airbrake *asynchronously*. # Attaches information from the Rack env. # @see Airbrake#notify, #notify_airbrake_sync def notify_airbrake(exception, params = {}, notifier_name = :default) return unless (notice = build_notice(exception, params, notifier_name)) Airbrake[notifier_name].notify(notice, params) end # A helper method for sending notices to Airbrake *synchronously*. # Attaches information from the Rack env. # @see Airbrake#notify_sync, #notify_airbrake def notify_airbrake_sync(exception, params = {}, notifier_name = :default) return unless (notice = build_notice(exception, params, notifier_name)) Airbrake[notifier_name].notify_sync(notice, params) end # @param [Exception] exception # @return [Airbrake::Notice] the notice with information from the Rack env def build_notice(exception, params = {}, notifier_name = :default) return unless (notice = Airbrake[notifier_name].build_notice(exception, params)) notice.stash[:rack_request] = request notice end end end end
Version data entries
21 entries across 21 versions & 1 rubygems