Skip to content

Commit

Permalink
Add missing documentation for Rails.error
Browse files Browse the repository at this point in the history
The functionality itself is documented, but not the accessor
  • Loading branch information
byroot committed Sep 2, 2022
1 parent d96612d commit e4c237e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions railties/lib/rails.rb
Expand Up @@ -80,6 +80,13 @@ def env=(environment)
@_env = ActiveSupport::EnvironmentInquirer.new(environment)
end

# Returns the ActiveSupport::ErrorReporter of the current Rails project,
# otherwise it returns +nil+ if there is no project.
#
# Rails.error.handle(IOError) do
# # ...
# end
# Rails.error.report(error)
def error
application && application.executor.error_reporter
end
Expand Down

0 comments on commit e4c237e

Please sign in to comment.