Sha256: 1e1d7029f4aae2ebe93ff8cafc3cb0a4db37b0ff62c411dea747e7a279df6c44
Contents?: true
Size: 759 Bytes
Versions: 13
Compression:
Stored size: 759 Bytes
Contents
require 'airbrake' require 'faraday' module Saddle module Middleware module Logging # Public: Reports exceptions to Airbrake # class AirbrakeLogger < Faraday::Middleware def initialize(app, airbrake_api_key=nil) super(app) @airbrake_api_key = airbrake_api_key end def call(env) begin @app.call(env) rescue => e # If we don't have an api key, use the default config if @airbrake_api_key ::Airbrake.notify(e, {:api_key => @airbrake_api_key} ) else ::Airbrake.notify(e) end # Re-raise the error raise end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems