Class: Bugsnag

Inherits:
Object
  • Object
show all
Defined in:
lib/bugsnag/em.rb

Class Method Summary collapse

Class Method Details

.auto_notify(exception, overrides = nil, request_data = nil) ⇒ Object



33
34
35
36
# File 'lib/bugsnag/em.rb', line 33

def auto_notify(exception, overrides=nil, request_data=nil)
  overrides = LSpace[:bugsnag].merge(overrides || {}) if LSpace[:bugsnag]
  auto_notify_without_lspace exception, overrides, request_data
end

.notify(exception, overrides = nil, request_data = nil) ⇒ Object Also known as: auto_notify_without_lspace



27
28
29
30
# File 'lib/bugsnag/em.rb', line 27

def notify(exception, overrides=nil, request_data=nil)
  overrides = LSpace[:bugsnag].merge(overrides || {}) if LSpace[:bugsnag]
  notify_without_lspace exception, overrides, request_data
end

.notify_without_lspaceObject



26
# File 'lib/bugsnag/em.rb', line 26

alias_method :notify_without_lspace, :notify

.with(overrides, &block) ⇒ Object

With let’s you set parameters on future calls to Bugsnag.notify.

It uses LSpace to track this data through asynchronous jumps (like making an HTTP request or setting a timer) so that it can be used in a fully eventmachine context.

Examples:

Bugsnag.with(user: {id: 'max'}, connection: {remote_ip: '127.0.0.1'}) do
  EM::next_tick do
    raise 'oops'
  end
end

Parameters:

  • overrides. (Object)

    @see Bugsnag.notify



21
22
23
24
# File 'lib/bugsnag/em.rb', line 21

def with(overrides, &block)
  overrides = (LSpace[:bugsnag] || {}).merge overrides
  LSpace.with(bugsnag: overrides, &block)
end