From 6912969287479a9f2afa20d06aa7ab54d66db063 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 9 Apr 2009 17:23:55 +0200 Subject: utils: fix safe_exec failures safe_exec should be less verbose when reporting problems, since the output might end up on IRC, and it should return a non-zero error code when failing, so that $? get set correctly. --- lib/rbot/core/utils/utils.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/rbot/core/utils/utils.rb b/lib/rbot/core/utils/utils.rb index c47601c1..92df73ff 100644 --- a/lib/rbot/core/utils/utils.rb +++ b/lib/rbot/core/utils/utils.rb @@ -284,11 +284,11 @@ module ::Irc $stderr.reopen($stdout) exec(command, *args) rescue Exception => e - puts "exec of #{command} led to exception: #{e.pretty_inspect}" - Kernel::exit! 0 + puts "exception #{e.pretty_inspect} trying to run #{command}" + Kernel::exit! 1 end puts "exec of #{command} failed" - Kernel::exit! 0 + Kernel::exit! 1 end } end -- cgit v1.2.3