|
98 | 98 |
|
99 | 99 | All exceptions are recorded automatically. No additional code required. |
100 | 100 |
|
| 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 | + |
101 | 107 | Please consult the [official guides](https://guides.rubyonrails.org/error_reporting.html) for an introduction to the error reporting API. |
102 | 108 |
|
103 | 109 | 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. |
@@ -161,6 +167,7 @@ You can configure Solid Errors via the Rails configuration object, under the `so |
161 | 167 | * `email_from` - The email address to send a notification from. See [Email notifications](#email-notifications) for more information. |
162 | 168 | * `email_to` - The email address(es) to send a notification to. See [Email notifications](#email-notifications) for more information. |
163 | 169 | * `email_subject_prefix` - Prefix added to the subject line for email notifications. See [Email notifications](#email-notifications) for more information. |
| 170 | +* `base_controller_class` - Specify a different controller as the base class for the Solid Errors controller. See [Authentication](#authentication) for more information. |
164 | 171 | * `destroy_after` - If set, Solid Errors will periodically destroy resolved records that are older than the value specified. See [Automatically destroying old records](#automatically-destroying-old-records) for more information. |
165 | 172 |
|
166 | 173 | ### Database Configuration |
@@ -218,6 +225,13 @@ authenticate :user, -> (user) { user.admin? } do |
218 | 225 | end |
219 | 226 | ``` |
220 | 227 |
|
| 228 | +You can also specify a different controller to use as the Solid Errors controller base class: |
| 229 | + |
| 230 | +```ruby |
| 231 | +# Override the base controller class with your own controller |
| 232 | +config.solid_errors.base_controller_class = "YourAdminController" |
| 233 | +``` |
| 234 | + |
221 | 235 | #### Email notifications |
222 | 236 |
|
223 | 237 | Solid Errors _can_ send email notifications whenever an error occurs, if your application has ActionMailer already properly setup to send emails. However, in order to activate this feature you must define the email address(es) to send the notifications to. Optionally, you can also define the email address to send the notifications from (useful if your email provider only allows emails to be sent from a predefined list of addresses) or simply turn off this feature altogether. You can also define a subject prefix for the email notifications to quickly identify the source of the error. |
|
0 commit comments