Merge branch 'fix-2221' into 'v2.0'
Improve error message when failing to load conf backend (#2221) See merge request lemonldap-ng/lemonldap-ng!146
This commit is contained in:
commit
e15797890d
|
@ -87,7 +87,7 @@ sub new {
|
|||
unless $self->{type} =~ /^Lemonldap::/;
|
||||
eval "require $self->{type}";
|
||||
if ($@) {
|
||||
$msg .= "Error: Unknown package $self->{type}.\n";
|
||||
$msg .= "Error: failed to load $self->{type}: \n $@";
|
||||
return 0;
|
||||
}
|
||||
return 0 unless $self->prereq;
|
||||
|
|
|
@ -20,7 +20,7 @@ my $confsection = "configuration";
|
|||
ok( (
|
||||
Lemonldap::NG::Common::Conf->new( type => 'bad' ) == 0
|
||||
and $Lemonldap::NG::Common::Conf::msg =~
|
||||
/Error: Unknown package Lemonldap::NG::Common::Conf::Backends::bad\.$/
|
||||
/Error: failed to load Lemonldap::NG::Common::Conf::Backends::bad/
|
||||
),
|
||||
'Bad module'
|
||||
) or print STDERR "Msg: $Lemonldap::NG::Common::Conf::msg\n";
|
||||
|
|
Loading…
Reference in New Issue
Block a user