From a18596f39fc93de7af6036b6d295a3042e64d3e9 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Tue, 12 Aug 2008 13:37:19 +0000 Subject: * fixed possible hiding of error messages when something goes wrong in a module that is being loaded dynamically (specifically the case when a plugin is trying to load the most appropriate Distro module) git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2033 95ad53e4-c205-0410-b2fa-d234c58c8868 --- lib/OpenSLX/Basics.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/OpenSLX/Basics.pm') diff --git a/lib/OpenSLX/Basics.pm b/lib/OpenSLX/Basics.pm index 07ab364b..5b43f155 100644 --- a/lib/OpenSLX/Basics.pm +++ b/lib/OpenSLX/Basics.pm @@ -605,13 +605,14 @@ sub instantiateClass $moduleName .= '.pm'; vlog(3, "trying to load $moduleName..."); + local @INC = @INC; foreach my $incPath (@$incPaths) { next if grep { $_ eq $incPath } @INC; unshift @INC, $incPath; } if (!eval { require $moduleName; 1 } ) { # check if module does not exists anywhere in search path - if (!-e $moduleName) { + if ($! == 2) { return if $flags->{acceptMissing}; die _tr("Module '%s' not found!\n", $moduleName); } @@ -733,10 +734,10 @@ sub loadDistroModule }; last if $loaded; if (!defined $loaded) { - vlog(0, _tr( + die _tr( "Error when trying to load distro module '%s':\n%s", $distroModule, $@ - )); + ); } } -- cgit v1.2.3-55-g7522