Remove error handling for evaluation errors

This commit is contained in:
Thibault Jouan
2013-08-13 00:11:53 +00:00
parent 0904fa1fc9
commit a5d9ca26f4
12 changed files with 1 additions and 146 deletions

View File

@@ -12,15 +12,7 @@ module Producer
def run!
check_arguments!
begin
recipe.evaluate env
rescue RecipeEvaluationError => e
backtrace = e.backtrace.reject { |l| l =~ /\/producer-core\// }
@stdout.puts [backtrace.shift, e.message].join ': '
@stdout.puts backtrace
exit 70
end
recipe.evaluate(env)
worker.process recipe.tasks
end

View File

@@ -2,8 +2,6 @@ module Producer
module Core
Error = Class.new(StandardError)
ConditionNotMetError = Class.new(Error)
RecipeEvaluationError = Class.new(StandardError)
TaskEvaluationError = Class.new(RecipeEvaluationError)
RemoteCommandExecutionError = Class.new(Error)
end
end

View File

@@ -18,10 +18,6 @@ module Producer
instance_eval &@block
end
self
rescue NameError => e
raise RecipeEvaluationError,
"invalid recipe keyword `#{e.name}'",
e.backtrace
end
private

View File

@@ -23,10 +23,6 @@ module Producer
@env = env
instance_eval &@block
rescue ConditionNotMetError
rescue NameError => e
raise TaskEvaluationError,
"invalid task action `#{e.name}'",
e.backtrace
end
private