Skip to content
Browse files

Adding error handling for incorrect Podfile.lock syntax

  • Loading branch information...
1 parent e269b2c commit 303dbb54aa0e075b53fc61d61b54e4eb270804ba @xslim xslim committed Oct 4, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/cocoapods/lockfile.rb
View
6 lib/cocoapods/lockfile.rb
@@ -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

0 comments on commit 303dbb5

Please sign in to comment.
Something went wrong with that request. Please try again.