Commit d3b1448b authored by Samuel E. Giddins's avatar Samuel E. Giddins

[SourcesManager] Fix reporting of failure to add a repo by url

parent 539dc7d8
...@@ -36,14 +36,16 @@ module Pod ...@@ -36,14 +36,16 @@ module Pod
def find_or_create_source_with_url(url) def find_or_create_source_with_url(url)
unless source = source_with_url(url) unless source = source_with_url(url)
name = name_for_url(url) name = name_for_url(url)
Command::Repo::Add.new(CLAide::ARGV.new([name, url])).run begin
Command::Repo::Add.new(CLAide::ARGV.new([name, url])).run
rescue Informative => e
raise Informative, "Unable to add a source with url `#{url}` " \
"named `#{name}`.\nYou can add it manually via " \
"`pod repo add NAME #{url}`."
end
source = source_with_url(url) source = source_with_url(url)
end end
unless source
raise Informative, "Unable to add a source with url `#{url}` named " \
"`#{name}`.\nYou can add it manually via `pod repo add NAME " \
"#{url}`.\n\n#{output}"
end
source source
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