Class: ConnectorsShared::ExceptionTracking

Inherits:
Object
  • Object
show all
Defined in:
lib/connectors_shared/exception_tracking.rb

Class Method Summary collapse

Class Method Details

.augment_exception(exception) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/connectors_shared/exception_tracking.rb', line 28

def augment_exception(exception)
  unless exception.respond_to?(:id)
    exception.instance_eval do
      def id
        @error_id ||= BSON::ObjectId.new.to_s
      end
    end
  end
end

.capture_exception(exception, context = {}) ⇒ Object



20
21
22
# File 'lib/connectors_shared/exception_tracking.rb', line 20

def capture_exception(exception, context = {})
  EnterpriseSearch::ExceptionTracking.log_exception(exception, :context => context)
end

.capture_message(message, context = {}) ⇒ Object



16
17
18
# File 'lib/connectors_shared/exception_tracking.rb', line 16

def capture_message(message, context = {})
  EnterpriseSearch::ExceptionTracking.capture_message(message, context)
end

.log_exception(exception, message = nil) ⇒ Object



24
25
26
# File 'lib/connectors_shared/exception_tracking.rb', line 24

def log_exception(exception, message = nil)
  EnterpriseSearch::ExceptionTracking.log_exception(exception, message, :logger => ConnectorsShared::Logger.logger)
end