method

report

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

When the block based handle and record methods are not suitable, you can directly use report

Rails.error.report(error, handled: true)