Exception: Spreewald::Steps::FollowTheLink::NoVisitableLinkFound

Inherits:
StandardError
  • Object
show all
Defined in:
lib/steps/follow_the_link.rb

Instance Method Summary collapse

Constructor Details

#initialize(paths, index) ⇒ NoVisitableLinkFound

Returns a new instance of NoVisitableLinkFound.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/steps/follow_the_link.rb', line 5

def initialize(paths, index)
  error_message = <<~MESSAGE
    Could not follow the #{index} link in the email.
  MESSAGE
  if paths&.empty?
    error_message << "Found no link paths in the email."
  else
    error_message << "Found these link paths in the email: #{paths.join(', ')}"
  end
  super(error_message)
end