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:
Xavier Guimard 2020-05-26 16:31:51 +02:00
commit e15797890d
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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";