summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/interpreter.rb
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2008-02-19 12:23:40 +1100
committerJames Turnbull <james@lovedthanlost.net>2008-02-19 12:23:40 +1100
commitd82bfd86288cc012018797d98168f918bff75778 (patch)
tree52d46190ea643203da5dbd601f48f0c295d09a9f /lib/puppet/parser/interpreter.rb
parent8754f41117540b9bb79f4561c99cd608c0115117 (diff)
downloadpuppet-d82bfd86288cc012018797d98168f918bff75778.tar.gz
puppet-d82bfd86288cc012018797d98168f918bff75778.tar.xz
puppet-d82bfd86288cc012018797d98168f918bff75778.zip
Attempt to fix #1040 - catching errors in compilation
Diffstat (limited to 'lib/puppet/parser/interpreter.rb')
-rw-r--r--lib/puppet/parser/interpreter.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb
index d4b7449fb..27192af17 100644
--- a/lib/puppet/parser/interpreter.rb
+++ b/lib/puppet/parser/interpreter.rb
@@ -25,7 +25,11 @@ class Puppet::Parser::Interpreter
# evaluate our whole tree
def compile(node)
raise Puppet::ParseError, "Could not parse configuration; cannot compile" unless env_parser = parser(node.environment)
- return Puppet::Parser::Compiler.new(node, env_parser).compile
+ begin
+ return Puppet::Parser::Compiler.new(node, env_parser).compile
+ rescue
+ raise Puppet::Error, "Could not compile node %s" % node
+ end
end
# create our interpreter