Improve CLI error reporting

This commit is contained in:
Thibault Jouan committed 2014-10-12 18:11:37 +00:00
1 parent f6237bfc0c
commit 25d03d4322
8 files changed
+142 -7

No files matched your search

+8 -1
View File
@@ -5,7 +5,14 @@ module Producer
class << self
def evaluate(file_path, env)
content = File.read(file_path)
Recipe.new(env).tap { |o| o.instance_eval content, file_path }
begin
Recipe.new(env).tap { |o| o.instance_eval content, file_path }
rescue Exception => e
fail RecipeEvaluationError, e.message, [
'%s (recipe)' % file_path,
*e.backtrace
]
end
end
end
end