diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2009-04-09 17:23:55 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2009-04-11 11:42:20 +0200 |
commit | 6912969287479a9f2afa20d06aa7ab54d66db063 (patch) | |
tree | 65dc5c38ff1526bdc302d054bcbe17f7693a217d /lib/rbot | |
parent | ae223f784f852ea27f8b0c7be55ae541a0e98f15 (diff) |
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.
Diffstat (limited to 'lib/rbot')
-rw-r--r-- | lib/rbot/core/utils/utils.rb | 6 |
1 files changed, 3 insertions, 3 deletions
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 |