Class: ProxyFetcher::Exceptions::AdapterSetupError

Inherits:
ProxyFetcher::Error
  • Object
show all
Defined in:
lib/proxy_fetcher/exceptions.rb

Overview

Exception for cases when HTML parser adapter can’t be installed. It will print the reason (backtrace) of the exception that caused an error.

Instance Method Summary collapse

Constructor Details

#initialize(adapter_name, error) ⇒ AdapterSetupError

Initialize new exception

Parameters:

  • adapter_name (String)

    configured adapter name

  • error (String)

    full setup error (backtrace)



113
114
115
116
117
# File 'lib/proxy_fetcher/exceptions.rb', line 113

def initialize(adapter_name, error)
  adapter = demodulize(adapter_name.gsub("Adapter", ""))

  super("can't setup '#{adapter}' adapter during the following error:\n\t#{error}'")
end