Move exception warnings in run function

This commit is contained in:
Brian Cain 2018-03-29 15:52:46 -07:00
parent e078767b2b
commit fd2878309b
No known key found for this signature in database
GPG Key ID: 43D51080D357A001
1 changed files with 5 additions and 4 deletions

View File

@ -170,16 +170,17 @@ module Vagrant
@machine.ui.error(data)
end
end
rescue Exception => e
# TODO: I18n me and write better message
@machine.ui.error("Trigger run failed:")
@machine.ui.error(e.message)
if on_error == :halt
@logger.debug("Trigger run encountered an error. Halting on error...")
# Raise proper Vagrant error to avoid ugly stacktrace
raise e
else
@logger.debug("Trigger run encountered an error. Continuing on anyway...")
# TODO: I18n me and write better message
@machine.ui.error("Trigger run failed:")
@machine.ui.error(e.message)
end
end
end