Permalink
Browse files

update-index.rb: updated error handling

  • Loading branch information...
1 parent d7ef310 commit 7c1dd16ddabdebef6869539e7603ed1ec0fc9fe4 @frsyuki frsyuki committed Jul 1, 2013
Showing with 6 additions and 3 deletions.
  1. +6 −3 update-index.rb
View
@@ -29,7 +29,12 @@ def get_quickstart_html(repo_url)
begin
if fname.include?('.')
data = RestClient.get("#{repo_url}/blob/master/#{fname}")
- html = Nokogiri::HTML(data).css('.file')[0].xpath('div').last.to_s
+ begin
+ html = Nokogiri::HTML(data).css('.file')[0].xpath('div').last.to_s
+ rescue
+ break # fail & skip
+ end
+
else
raw_url = repo_url.sub('github.com', 'raw.github.com')
data = RestClient.get("#{raw_url}/master/#{fname}")
@@ -39,8 +44,6 @@ def get_quickstart_html(repo_url)
return html, fname
rescue RestClient::ResourceNotFound
# do nothing
- rescue
- STDERR.puts $!
end
}

0 comments on commit 7c1dd16

Please sign in to comment.