]> git.donarmstrong.com Git - infobot.git/commitdiff
- if core moduels fail to load, exit out properly.
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sun, 28 Jan 2001 13:14:34 +0000 (13:14 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sun, 28 Jan 2001 13:14:34 +0000 (13:14 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@256 c11ca15a-4712-0410-83d8-924469b57eb5

blootbot/src/modules.pl

index 3c52c0f20d46a4973d38dea7fed6e7484f87c99d..ef18cbbe094de55a4977a4e7914b8be9f1b130c8 100644 (file)
@@ -64,7 +64,9 @@ sub loadCoreModules {
        ### TODO: use eval and exit gracefully?
        eval "require \"$mod\"";
        if ($@) {
-           &WARN("lCM => $@");
+           &ERROR("lCM => $@");
+           &shutdown();
+           exit 1;
        }
 
        $moduleAge{$mod} = (stat $mod)[9];
@@ -129,6 +131,7 @@ sub loadFactoidsModules {
        eval "require \"$mod\"";
        if ($@) {
            &WARN("lFM: $@");
+           exit 1;
        }
 
        $moduleAge{$mod} = (stat $mod)[9];
@@ -176,11 +179,23 @@ sub loadMyModulesNow {
     &status("Loading MyModules...");
     foreach (@myModulesLoadNow) {
        $total++;
+       if (!defined $_) {
+           &WARN("mMLN: null element.");
+           next;
+       }
+
+       &DEBUG("_ => $_");
+
+       if (!&IsParam($_) and !&IsChanConf($_)) {
+           if (exists $myModules{$_}) {
+               &DEBUG("myModule: $myModules{$_} (1) not loaded.");
+           } else {
+               &DEBUG("myModule: $_ (2) not loaded.");
+           }
 
-       if (!exists $param{$_}) {
-           &DEBUG("myModule: $myModules{$_} not loaded.");
            next;
        }
+
        &loadMyModule($myModules{$_});
        $loaded++;
     }