Class: Periskop::Client::ExceptionCollector

Inherits:
Object
  • Object
show all
Defined in:
lib/periskop/client/collector.rb

Overview

ExceptionCollector collects reported exceptions and aggregates them

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeExceptionCollector

Returns a new instance of ExceptionCollector.



9
10
11
12
# File 'lib/periskop/client/collector.rb', line 9

def initialize
  @aggregated_exceptions_dict = {}
  @uuid = SecureRandom.uuid
end

Instance Attribute Details

#aggregated_exceptions_dictObject (readonly)

Returns the value of attribute aggregated_exceptions_dict.



14
15
16
# File 'lib/periskop/client/collector.rb', line 14

def aggregated_exceptions_dict
  @aggregated_exceptions_dict
end

Instance Method Details

#aggregated_exceptionsObject



16
17
18
# File 'lib/periskop/client/collector.rb', line 16

def aggregated_exceptions
  Payload.new(@aggregated_exceptions_dict.values, @uuid)
end

#report(exception) ⇒ Object

Report an exception Params:

exception

captured exception



23
24
25
# File 'lib/periskop/client/collector.rb', line 23

def report(exception)
  add_exception(exception, nil)
end

#report_with_context(exception, context) ⇒ Object

Report an exception with context Params:

exception

captured exception

context

HTTP context of the exception



31
32
33
# File 'lib/periskop/client/collector.rb', line 31

def report_with_context(exception, context)
  add_exception(exception, context)
end