Exception: Accessibility::SearchFailure

Inherits:
NoMethodError
  • Object
show all
Defined in:
lib/accessibility/errors.rb

Overview

Error raised when an implicit search fails to return a result.

Instance Method Summary collapse

Constructor Details

#initialize(searcher, searchee, filters) { ... } ⇒ SearchFailure

Returns a new instance of SearchFailure.

Parameters:

Yields:

  • Optional block that would have been used for a search filter



11
12
13
14
15
16
17
18
19
# File 'lib/accessibility/errors.rb', line 11

def initialize searcher, searchee, filters, &block
  filters = {} unless filters.kind_of? Hash
  msg  = "Could not find `#{pp_searchee searchee, filters, &block}` "
  msg << "as a child of #{searcher.class}\n"
  msg << "Element Path:\n\t" << path_to(searcher)
  # @todo Consider turning this on by default
  msg << "\nSubtree:\n\n" << searcher.inspect_subtree if Accessibility.debug?
  super msg
end