# Error Reporting API - Class Google::Cloud::ErrorReporting::Railtie (v0.45.1)

0.45.1 (latest) 0.45.0 0.44.0 0.43.0 0.42.3 Reference documentation and code samples for the Error Reporting API class Google::Cloud::ErrorReporting::Railtie.

## Railtie

Google::Cloud::ErrorReporting::Railtie automatically add the
[Middleware](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting/latest/Google-Cloud-ErrorReporting-Middleware "Google::Cloud::ErrorReporting::Middleware (class)") to Rack in a Rails
environment. It will automatically capture Exceptions from the Rails app
and report them to the Error Reporting service.

The Middleware is only added when certain conditions are met. See
`Google::Cloud.configure.use_error_reporting` for detail.

When loaded, the [Middleware](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting/latest/Google-Cloud-ErrorReporting-Middleware "Google::Cloud::ErrorReporting::Middleware (class)") will be
inserted after ActionDispatch::DebugExceptions or
ActionDispatch::ShowExceptions Middleware, which allows it to intercept
and handle all Exceptions without interfering with Rails's normal error
pages.
See the [Configuration
Guide](https://googleapis.dev/ruby/stackdriver/latest/file.INSTRUMENTATION_CONFIGURATION.html)
on how to configure the Railtie and Middleware.

## Inherits

- Rails::Railtie