Commit 86211405 authored by Hugo Tunius's avatar Hugo Tunius Committed by Kyle Fuller

[PodspecSource] Rescue HTTPError exceptions and handle them

parent d0b598a3
...@@ -42,6 +42,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -42,6 +42,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Hugo Tunius](https://github.com/K0nserv) [Hugo Tunius](https://github.com/K0nserv)
[#2579](https://github.com/CocoaPods/CocoaPods/issues/2579) [#2579](https://github.com/CocoaPods/CocoaPods/issues/2579)
* Any errors which occur during fetching of external podspecs over HTTP
will now be gracefully handled.
[Hugo Tunius](https://github.com/K0nserv)
[#2823](https://github.com/CocoaPods/CocoaPods/issues/2823)
## 0.36.0.beta.1 ## 0.36.0.beta.1
......
...@@ -11,7 +11,12 @@ module Pod ...@@ -11,7 +11,12 @@ module Pod
UI.titled_section(title, :verbose_prefix => '-> ') do UI.titled_section(title, :verbose_prefix => '-> ') do
is_json = podspec_uri.split('.').last == 'json' is_json = podspec_uri.split('.').last == 'json'
require 'open-uri' require 'open-uri'
open(podspec_uri) { |io| store_podspec(sandbox, io.read, is_json) } begin
open(podspec_uri) { |io| store_podspec(sandbox, io.read, is_json) }
rescue OpenURI::HTTPError => e
status = e.io.status.join(' ')
raise Informative, "Failed to fetch podspec for `#{name}` at #{podspec_uri}. Error: #{status}"
end
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment