class Grubby::Scraper::Error

Constants

BACKTRACE_CLEANER

@!visibility private

Attributes

scraper[RW]

The Scraper that raised this Error.

@return [Grubby::Scraper]

Public Class Methods

new(scraper) click to toggle source

@!visibility private

Calls superclass method
# File lib/grubby/scraper.rb, line 274
def initialize(scraper)
  self.scraper = scraper

  listing = scraper.errors.
    reject{|field, error| error.is_a?(FieldScrapeFailedError) }.
    map do |field, error|
      "* `#{field}` (#{error.class})\n" +
        error.message.indent(2) + "\n\n" +
        BACKTRACE_CLEANER.clean(error.backtrace).join("\n").indent(4) + "\n"
    end.
    join("\n")

  super("Failed to scrape the following fields:\n#{listing}")
end