mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-26 13:59:47 +01:00
Replace die with croak, and move Net::IRC::Connection::DESTROY redefinition to before any deaths
This commit is contained in:
parent
d31b7594a2
commit
4e53210445
@ -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`;
|
||||
|
Loading…
Reference in New Issue
Block a user