Skip to content

Commit e0f8a60

Browse files
committed
ActiveSupport::ErrorReporter#report does not accept String argument
Fixes rails#53997 [ci skip]
1 parent e82b645 commit e0f8a60

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

activesupport/lib/active_support/error_reporter.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,12 @@ def set_context(...)
207207
#
208208
# Rails.error.report(error)
209209
#
210+
# The +error+ argument must be an instance of Exception.
211+
#
212+
# Rails.error.report(Exception.new("Something went wrong"))
213+
#
214+
# Otherwise you can use #unexpected to report an error which does accept a
215+
# string argument.
210216
def report(error, handled: true, severity: handled ? :warning : :error, context: {}, source: DEFAULT_SOURCE)
211217
return if error.instance_variable_defined?(:@__rails_error_reported)
212218
raise ArgumentError, "Reported error must be an Exception, got: #{error.inspect}" unless error.is_a?(Exception)

0 commit comments

Comments
 (0)