Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: airbrake/airbrake
...
head fork: dlitz/airbrake
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Mar 28, 2012
Dwayne Litzenberger Fix reporting of middleware errors under Rails 3
This fixes the issue (#76) where
errors occurring in the middleware stack (e.g. in the ActiveRecord session
store) do not get reported.

In Rails 3, the Airbrake::Rack middleware was being inserted near the end of
the middleware stack, just before Application.routes.  This change places the
middleware much earlier in the stack: just after
ActionDispatch::ShowExceptions.

This makes airbrake's behaviour similar to how it functioned in Rails 2, with
Airbrake::Rack inserted just after ActionController::Failsafe.

Example middleware stack before:

  use Airbrake::UserInformer
  use ActionDispatch::Static
  use Rack::Lock
  use #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x1020eb728>
  use Rack::Runtime
  use Rack::MethodOverride
  use ActionDispatch::RequestId
  use Rails::Rack::Logger
  use ActionDispatch::ShowExceptions
  use ActionDispatch::DebugExceptions
  use ActionDispatch::RemoteIp
  use ActionDispatch::Reloader
  use ActionDispatch::Callbacks
  use ActiveRecord::ConnectionAdapters::ConnectionManagement
  use ActiveRecord::QueryCache
  use ActionDispatch::Cookies
  use ActionDispatch::Session::CookieStore
  use ActionDispatch::Flash
  use ActionDispatch::ParamsParser
  use ActionDispatch::Head
  use Rack::ConditionalGet
  use Rack::ETag
  use ActionDispatch::BestStandardsSupport
  use Airbrake::Rack
  run SampleApp::Application.routes

Example middleware stack after:

  use Airbrake::UserInformer
  use ActionDispatch::Static
  use Rack::Lock
  use #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x10224a3f8>
  use Rack::Runtime
  use Rack::MethodOverride
  use ActionDispatch::RequestId
  use Rails::Rack::Logger
  use ActionDispatch::ShowExceptions
  use Airbrake::Rack
  use ActionDispatch::DebugExceptions
  use ActionDispatch::RemoteIp
  use ActionDispatch::Reloader
  use ActionDispatch::Callbacks
  use ActiveRecord::ConnectionAdapters::ConnectionManagement
  use ActiveRecord::QueryCache
  use ActionDispatch::Cookies
  use ActiveRecord::SessionStore
  use ActionDispatch::Flash
  use ActionDispatch::ParamsParser
  use ActionDispatch::Head
  use Rack::ConditionalGet
  use Rack::ETag
  use ActionDispatch::BestStandardsSupport
  run SampleApp::Application.routes
73b4bb8
Dwayne Litzenberger Build forked version 3.0.9.0.pw1 6183efa
Showing with 2 additions and 2 deletions.
  1. +1 −1  lib/airbrake/railtie.rb
  2. +1 −1  lib/airbrake/version.rb
View
2  lib/airbrake/railtie.rb
@@ -9,7 +9,7 @@ class Railtie < ::Rails::Railtie
end
initializer "airbrake.use_rack_middleware" do |app|
- app.config.middleware.use "Airbrake::Rack"
+ app.config.middleware.insert_after "ActionDispatch::ShowExceptions", "Airbrake::Rack"
app.config.middleware.insert 0, "Airbrake::UserInformer"
end
View
2  lib/airbrake/version.rb
@@ -1,3 +1,3 @@
module Airbrake
- VERSION = "3.0.9"
+ VERSION = "3.0.9.0.pw1"
end

No commit comments for this range

Something went wrong with that request. Please try again.