synced_folders/rsync-auto: don't crash if rsync command fails [GH-4991]

This commit is contained in:
Mitchell Hashimoto 2015-07-09 11:11:58 -06:00
parent 7e61afd480
commit 9596b7a46c
2 changed files with 10 additions and 0 deletions

View File

@ -191,6 +191,10 @@ module VagrantPlugins
# halt is happening. Just notify the user but don't fail out.
opts[:machine].ui.error(I18n.t(
"vagrant.rsync_communicator_not_ready_callback"))
rescue Vagrant::Errors::RSyncError => e
# Error executing rsync, so show an error
opts[:machine].ui.error(I18n.t(
"vagrant.rsync_auto_rsync_error", message: e.to_s))
end
end
end

View File

@ -204,6 +204,12 @@ en:
have specified `rsync_auto` to be false.
rsync_auto_path: |-
Watching: %{path}
rsync_auto_rsync_error: |-
There was an error while executing rsync. The error is shown below.
This may not be critical since rsync sometimes fails, but if this message
repeats, then please fix the issue:
%{message}
rsync_communicator_not_ready: |-
The machine is reporting that it is not ready for rsync to
communicate with it. Verify that this machine is properly running.