summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util/fileparsing.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/util/fileparsing.rb')
-rw-r--r--lib/puppet/util/fileparsing.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/puppet/util/fileparsing.rb b/lib/puppet/util/fileparsing.rb
index 169320ae5..26be0f506 100644
--- a/lib/puppet/util/fileparsing.rb
+++ b/lib/puppet/util/fileparsing.rb
@@ -219,8 +219,16 @@ module Puppet::Util::FileParsing
# Split a bunch of text into lines and then parse them individually.
def parse(text)
+ count = 1
lines(text).collect do |line|
- parse_line(line)
+ count += 1
+ if val = parse_line(line)
+ val
+ else
+ error = Puppet::Error.new("Could not parse line %s" % line.inspect)
+ error.line = count
+ raise error
+ end
end
end