Hey! Is there a way to tune how to send errors to our exception manager (for rails)? Like I want to rescue_from
in the base forest controller and add context to the error like the user or more details about the request.
Thank you!
Hey! Is there a way to tune how to send errors to our exception manager (for rails)? Like I want to rescue_from
in the base forest controller and add context to the error like the user or more details about the request.
Thank you!
The agent uses a custom Reporter
to catch exception, but you could create your own reporter to override it. forest-rails/resources_controller.rb at main · ForestAdmin/forest-rails · GitHub
For example :
create the file lib/my_reporter.rb
class MyReporter
def report (error)
# you own logic here
puts "An user has encountered an error: #{error}"
end
end
Then into your config/initializers/forest_liana.rb, you need to add the following line to use it.
ForestLiana.reporter = MyReporter.new
However you can’t have access to the current user in this kind of reporter.
Yeah, but doesn’t catch all the errors like middleware ones (rack timeout), so I might need to build one, thank you anyway!