Class: ConnectorsShared::ExceptionTracking
- Inherits:
-
Object
- Object
- ConnectorsShared::ExceptionTracking
- Defined in:
- lib/connectors_shared/exception_tracking.rb
Class Method Summary collapse
- .augment_exception(exception) ⇒ Object
- .capture_exception(exception, context = {}) ⇒ Object
- .capture_message(message, context = {}) ⇒ Object
- .log_exception(exception, message = nil) ⇒ Object
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 (, context = {}) EnterpriseSearch::ExceptionTracking.(, context) end |
.log_exception(exception, message = nil) ⇒ Object
24 25 26 |
# File 'lib/connectors_shared/exception_tracking.rb', line 24 def log_exception(exception, = nil) EnterpriseSearch::ExceptionTracking.log_exception(exception, , :logger => ConnectorsShared::Logger.logger) end |