Error handling FTW

This commit is contained in:
Parker Moore 2013-10-05 20:57:03 -04:00
parent e692d8ea1a
commit f43163b9b7

View File

@ -88,6 +88,9 @@ module Jekyll
def handle_gist_redirecting(data) def handle_gist_redirecting(data)
redirected_url = data.header['Location'] redirected_url = data.header['Location']
if redirected_url.nil? || redirected_url.empty?
raise ArgumentError, "GitHub replied with a 302 but didn't provide a location in the response headers."
end
get_web_content(redirected_url) get_web_content(redirected_url)
end end