Merge pull request #438 from roman-yepishev/gist_error
Raise RuntimeError when gist is unavailable - #437
This commit is contained in:
commit
51905b6a90
@ -84,6 +84,9 @@ module Jekyll
|
|||||||
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
||||||
request = Net::HTTP::Get.new raw_uri.request_uri
|
request = Net::HTTP::Get.new raw_uri.request_uri
|
||||||
data = https.request request
|
data = https.request request
|
||||||
|
if Integer(data.code) != 200
|
||||||
|
raise RuntimeError, "Gist replied with #{data.code} for #{gist_url}"
|
||||||
|
end
|
||||||
data = data.body
|
data = data.body
|
||||||
cache gist, file, data unless @cache_disabled
|
cache gist, file, data unless @cache_disabled
|
||||||
data
|
data
|
||||||
|
Loading…
Reference in New Issue
Block a user