Warden only logs an error once
This commit is contained in:
parent
cc24d7b196
commit
e16010041a
|
@ -19,6 +19,7 @@ module Vagrant
|
||||||
@stack = []
|
@stack = []
|
||||||
@actions = actions.map { |m| finalize_action(m, env) }
|
@actions = actions.map { |m| finalize_action(m, env) }
|
||||||
@logger = Log4r::Logger.new("vagrant::action::warden")
|
@logger = Log4r::Logger.new("vagrant::action::warden")
|
||||||
|
@last_error = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def call(env)
|
def call(env)
|
||||||
|
@ -37,7 +38,13 @@ module Vagrant
|
||||||
# we just exit immediately.
|
# we just exit immediately.
|
||||||
raise
|
raise
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
|
# We guard this so that the Warden only outputs this once for
|
||||||
|
# an exception that bubbles up.
|
||||||
|
if e != @last_error
|
||||||
@logger.error("Error occurred: #{e}")
|
@logger.error("Error occurred: #{e}")
|
||||||
|
@last_error = e
|
||||||
|
end
|
||||||
|
|
||||||
env["vagrant.error"] = e
|
env["vagrant.error"] = e
|
||||||
|
|
||||||
# Something went horribly wrong. Start the rescue chain then
|
# Something went horribly wrong. Start the rescue chain then
|
||||||
|
|
Loading…
Reference in New Issue