Class: CDMDEXER::TransformationErrorMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/cdmdexer/transformation_error_message.rb

Overview

Raise anything but timeout errors or other http connection errors Notify downstream in case users want to log the non-timeout errors

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message: :MISSING_ERROR_MESSAGE, notification_klass: CDMDEXER::CdmError) ⇒ TransformationErrorMessage

Returns a new instance of TransformationErrorMessage.



6
7
8
9
10
# File 'lib/cdmdexer/transformation_error_message.rb', line 6

def initialize(message: :MISSING_ERROR_MESSAGE,
               notification_klass: CDMDEXER::CdmError)
  @notification_klass = notification_klass
  @message = message
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



5
6
7
# File 'lib/cdmdexer/transformation_error_message.rb', line 5

def message
  @message
end

#notification_klassObject (readonly)

Returns the value of attribute notification_klass.



5
6
7
# File 'lib/cdmdexer/transformation_error_message.rb', line 5

def notification_klass
  @notification_klass
end

Instance Method Details

#notifyObject



12
13
14
15
# File 'lib/cdmdexer/transformation_error_message.rb', line 12

def notify
  notification_klass.call! message
  raise message if http_error?
end