class Sentry::Client

def event_from_exception(exception, hint = {})

Returns:
  • (Event, nil) -

Parameters:
  • hint (Hash) -- the hint data that'll be passed to `before_send` callback and the scope's event processors.
  • exception (Exception) -- the exception to be reported.
def event_from_exception(exception, hint = {})
  return unless @configuration.sending_allowed?
  ignore_exclusions = hint.delete(:ignore_exclusions) { false }
  return if !ignore_exclusions && !@configuration.exception_class_allowed?(exception)
  integration_meta = Sentry.integrations[hint[:integration]]
  ErrorEvent.new(configuration: configuration, integration_meta: integration_meta).tap do |event|
    event.add_exception_interface(exception)
    event.add_threads_interface(crashed: true)
    event.level = :error
  end
end