Exception: Smith::ToolFailureNotificationFailed

Inherits:
Error
  • Object
show all
Defined in:
lib/smith/tool_failure_notification_failed.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dispatch_error:, notification_error:) ⇒ ToolFailureNotificationFailed

Returns a new instance of ToolFailureNotificationFailed.



19
20
21
22
23
24
25
26
27
# File 'lib/smith/tool_failure_notification_failed.rb', line 19

def initialize(dispatch_error:, notification_error:)
  @dispatch_error = dispatch_error
  @notification_error = notification_error
  @details = build_details
  super(
    "host failed to record a terminal tool outcome: " \
    "#{@details.fetch(:notification_error_class)}: #{@details.fetch(:notification_error_message)}"
  )
end

Instance Attribute Details

#detailsObject (readonly)

Returns the value of attribute details.



17
18
19
# File 'lib/smith/tool_failure_notification_failed.rb', line 17

def details
  @details
end

#dispatch_errorObject (readonly)

Returns the value of attribute dispatch_error.



17
18
19
# File 'lib/smith/tool_failure_notification_failed.rb', line 17

def dispatch_error
  @dispatch_error
end

#notification_errorObject (readonly)

Returns the value of attribute notification_error.



17
18
19
# File 'lib/smith/tool_failure_notification_failed.rb', line 17

def notification_error
  @notification_error
end

Class Method Details

.from_details(details) ⇒ Object



39
40
41
42
43
44
45
# File 'lib/smith/tool_failure_notification_failed.rb', line 39

def self.from_details(details)
  values = normalize_details(details)
  new(
    dispatch_error: restored_error(values, :dispatch_error),
    notification_error: restored_error(values, :notification_error)
  )
end