method

report

report(error, handled: true, severity: handled ? :warning : :error, context: {}, source: DEFAULT_SOURCE)
public

Report an error directly to subscribers. You can use this method when the block-based #handle and #record methods are not suitable.

Rails.error.report(error)

The error argument must be an instance of Exception.

Rails.error.report(Exception.new("Something went wrong"))

Otherwise you can use #unexpected to report an error which does accept a string argument.