]> git.imager.perl.org - bse.git/commitdiff
log errors for nadmin.pl/nuser.pl when the controlled fails to load
authorTony Cook <tony@develop-help.com>
Fri, 17 Jul 2015 06:44:13 +0000 (16:44 +1000)
committerTony Cook <tony@develop-help.com>
Fri, 17 Jul 2015 06:44:13 +0000 (16:44 +1000)
site/cgi-bin/modules/BSE/UI/NUser.pm

index ce9821b90eeb5f105c8dd83277882778f684d107..7092e2dc28a6f15d5711d21609499378649465b9 100644 (file)
@@ -2,7 +2,7 @@ package BSE::UI::NUser;
 use strict;
 use base 'BSE::UI::Dispatch';
 
-our $VERSION = "1.000";
+our $VERSION = "1.001";
 
 sub controller_section {
   'nuser controllers';
@@ -39,7 +39,23 @@ sub dispatch {
     require $controller_file;
   };
   if ($@) {
-    print STDERR "Error loading controller $controller_file: $@";
+    my $error = $@;
+    print STDERR "Error loading controller $controller_file: $error\n";
+    eval {
+      require BSE::TB::AuditLog;
+      BSE::TB::AuditLog->log
+         (
+          component => "nadmin::load",
+          level => "critical",
+          actor => "S",
+          msg => "Failed to load module $controller_class",
+          dump => <<EOS
+Class: $controller_class
+File:  $controller_file
+Error: $error
+EOS
+         );
+    };
     return $class->error($req, "Internal error: Could not load controller class");
   }
   my %opts;