Use raise instead of fail in rescue statements

This commit is contained in:
Thibault Jouan 2015-05-12 18:00:51 +00:00
parent ac8b115d0f
commit 797a757469
2 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ module Producer
def [](*args) def [](*args)
@registry.fetch *args @registry.fetch *args
rescue KeyError rescue KeyError
fail RegistryKeyError, args.first.inspect raise RegistryKeyError, args.first.inspect
end end
alias get [] alias get []

View File

@ -8,7 +8,7 @@ module Producer
begin begin
Recipe.new(env).tap { |o| o.instance_eval content, file_path } Recipe.new(env).tap { |o| o.instance_eval content, file_path }
rescue Exception => e rescue Exception => e
fail RecipeEvaluationError, e.message, [ raise RecipeEvaluationError, e.message, [
'%s (recipe)' % file_path, '%s (recipe)' % file_path,
*e.backtrace *e.backtrace
] ]