Use raise instead of fail in rescue statements
This commit is contained in:
parent
ac8b115d0f
commit
797a757469
@ -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 []
|
||||||
|
|
||||||
|
@ -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
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user