Class: Periskop::Client::ExceptionCollector
- Inherits:
-
Object
- Object
- Periskop::Client::ExceptionCollector
- Defined in:
- lib/periskop/client/collector.rb
Overview
ExceptionCollector collects reported exceptions and aggregates them
Instance Attribute Summary collapse
-
#aggregated_exceptions_dict ⇒ Object
readonly
Returns the value of attribute aggregated_exceptions_dict.
Instance Method Summary collapse
- #aggregated_exceptions ⇒ Object
-
#initialize ⇒ ExceptionCollector
constructor
A new instance of ExceptionCollector.
-
#report(exception) ⇒ Object
- Report an exception Params: exception
-
captured exception.
-
#report_with_context(exception, context) ⇒ Object
- Report an exception with context Params: exception
- captured exception context
-
HTTP context of the exception.
Constructor Details
#initialize ⇒ ExceptionCollector
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_dict ⇒ Object (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_exceptions ⇒ Object
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 |