Skip to content

Commit

Permalink
Adding error handling for incorrect Podfile.lock syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
xslim committed Oct 4, 2012
1 parent e269b2c commit 303dbb5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/cocoapods/lockfile.rb
Expand Up @@ -8,7 +8,11 @@ class Lockfile
#
def self.from_file(path)
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.defined_in_file = path
lockfile
Expand Down

0 comments on commit 303dbb5

Please sign in to comment.