Skip to content

Commit 4a25d75

Browse files
committed
updated documentation to show how to add additional information to the context
1 parent b75251b commit 4a25d75

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ end
9898

9999
All exceptions are recorded automatically. No additional code required.
100100

101+
You can add default additional information to the context of the error by adding this line to your application controller:
102+
```ruby
103+
before_action { Rails.error.set_context(request_url: request.original_url, params: params, session: session.inspect) }
104+
```
105+
The additional context information will be automatically displayed on the occurence details page.
106+
101107
Please consult the [official guides](https://guides.rubyonrails.org/error_reporting.html) for an introduction to the error reporting API.
102108

103109
There are intentionally few features; you can view and resolve errors. That’s it. The goal is to provide a simple, lightweight, and performant solution for tracking exceptions in your Rails application. If you need more features, you should probably use a 3rd party service like [Honeybadger](https://www.honeybadger.io/), whose MIT-licensed [Ruby agent gem](https://github.com/honeybadger-io/honeybadger-ruby) provided a couple of critical pieces of code for this project.

0 commit comments

Comments
 (0)