Commit 303dbb54 authored by Taras Kalapun's avatar Taras Kalapun

Adding error handling for incorrect Podfile.lock syntax

parent e269b2c5
...@@ -8,7 +8,11 @@ module Pod ...@@ -8,7 +8,11 @@ module Pod
# #
def self.from_file(path) def self.from_file(path)
return nil unless path.exist? return nil unless path.exist?
hash = YAML.load(File.open(path)) begin
hash = YAML.load(File.open(path))
rescue Exception => e
raise Informative, "Podfile.lock syntax error: #{e.inspect}"
end
lockfile = Lockfile.new(hash) lockfile = Lockfile.new(hash)
lockfile.defined_in_file = path lockfile.defined_in_file = path
lockfile lockfile
......
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