From dce4baf0f08a072c9dd76ab7db1e8aa884886285 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Sat, 1 Apr 2017 13:00:19 -0700 Subject: also need to wrap Errno::EPIPE here at least possibly others Signed-off-by: Lamont Granquist --- lib/chef/provider/cron.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/chef/provider/cron.rb') diff --git a/lib/chef/provider/cron.rb b/lib/chef/provider/cron.rb index ae2c482475..c232585c18 100644 --- a/lib/chef/provider/cron.rb +++ b/lib/chef/provider/cron.rb @@ -203,14 +203,14 @@ class Chef so = shell_out!("crontab -l -u #{new_resource.user}", returns: [0, 1]) return nil if so.exitstatus == 1 so.stdout - rescue Mixlib::ShellOut::ShellCommandFailed => e + rescue => e raise Chef::Exceptions::Cron, "Error determining state of #{new_resource.name}, error: #{e}" end def write_crontab(crontab) write_exception = false so = shell_out!("crontab -u #{new_resource.user} -", input: crontab) - rescue Mixlib::ShellOut::ShellCommandFailed => e + rescue => e raise Chef::Exceptions::Cron, "Error updating state of #{new_resource.name}, error: #{e}" end -- cgit v1.2.1