Browse files

rescue RestClient::RequestFailed instead of RestClient::RequestTimeou…

…t; broader error, also includes HTTP 500 etc
  • Loading branch information...
1 parent f04ffae commit fcaaa4aab40146ae97f242718309ffc8028881d2 @MatmaRex committed Apr 16, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 zb.rb
View
6 zb.rb
@@ -175,7 +175,7 @@ def graph.walk &block
end
end
end
- rescue Timeout::Error, Errno::ETIMEDOUT, RestClient::RequestTimeout
+ rescue Timeout::Error, Errno::ETIMEDOUT, RestClient::RequestFailed
puts "Timed out while listing categories for #{root}; retrying..."
retry
end
@@ -208,7 +208,7 @@ def graph.walk &block
new_titles = list_of_titles()
user_notif_sett = get_user_notification_settings()
end
- rescue Timeout::Error, Errno::ETIMEDOUT, RestClient::RequestTimeout
+ rescue Timeout::Error, Errno::ETIMEDOUT, RestClient::RequestFailed
puts "Timed out while downloading list of titles or user settings; retrying..."
retry
end
@@ -260,7 +260,7 @@ def graph.walk &block
puts "Notifying #{ns}:#{page} about #{articles_hash.map{|a| a[0]}.join(', ')}."
notify_user_zb ns, page, articles_hash
end
- rescue Timeout::Error, Errno::ETIMEDOUT, RestClient::RequestTimeout
+ rescue Timeout::Error, Errno::ETIMEDOUT, RestClient::RequestFailed
puts "Timed out; retrying..."
retry
end

0 comments on commit fcaaa4a

Please sign in to comment.