Method: Sentry::Client#event_from_message

Defined in:
lib/sentry/client.rb

#event_from_message(message, hint = {}, backtrace: nil) ⇒ Event

Initializes an Event object with the given message.

Parameters:

  • message (String)

    the message to be reported.

  • hint (Hash) (defaults to: {})

    the hint data that’ll be passed to before_send callback and the scope’s event processors.

Returns:



164
165
166
167
168
169
170
171
172
# File 'lib/sentry/client.rb', line 164

def event_from_message(message, hint = {}, backtrace: nil)
  return unless @configuration.sending_allowed?

  integration_meta = Sentry.integrations[hint[:integration]]
  event = ErrorEvent.new(configuration: configuration, integration_meta: integration_meta, message: message)
  event.add_threads_interface(backtrace: backtrace || caller)
  event.level = :error
  event
end