Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add URI to timeout message #4

Open
rb2k opened this issue Jul 13, 2010 · 0 comments
Open

add URI to timeout message #4

rb2k opened this issue Jul 13, 2010 · 0 comments

Comments

@rb2k
Copy link
Contributor

rb2k commented Jul 13, 2010

It would be nice if the "robots.txt request timed out" would tell for which uri it actually failed.
This is the method in question:

  def self.get_robots_txt(uri, user_agent)
    begin
      Timeout::timeout(Robots.timeout) do
        io = URI.join(uri.to_s, "/robots.txt").open("User-Agent" => user_agent) rescue nil
      end 
    rescue Timeout::Error
      STDERR.puts "robots.txt request timed out"
    end
  end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant