From 4e5321044571f487b7937402b2e695028294155a Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 27 May 2010 09:29:17 +0000 Subject: [PATCH] Replace die with croak, and move Net::IRC::Connection::DESTROY redefinition to before any deaths --- PBot/FactoidModuleLauncher.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PBot/FactoidModuleLauncher.pm b/PBot/FactoidModuleLauncher.pm index b33fd8e7..b39d0090 100644 --- a/PBot/FactoidModuleLauncher.pm +++ b/PBot/FactoidModuleLauncher.pm @@ -124,15 +124,15 @@ sub execute_module { if($pid == 0) { # start child block $self->{child} = 1; # set to be killed after returning - if(not chdir $module_dir) { - $self->{pbot}->logger->log("Could not chdir to '$module_dir': $!\n"); - die $!; - } - no warnings; *Net::IRC::Connection::DESTROY = sub { return; }; use warnings; + if(not chdir $module_dir) { + $self->{pbot}->logger->log("Could not chdir to '$module_dir': $!\n"); + Carp::croak("Could not chdir to '$module_dir': $!"); + } + if(defined $tonick) { $self->{pbot}->logger->log("($from): $nick!$user\@$host) sent to $tonick\n"); $text = `$module_dir/$module $arguments`;