Errors were not reported

This commit is contained in:
Xavier Guimard 2016-01-07 12:34:27 +00:00
parent e2745c5e83
commit fbf1226710

View File

@ -1,5 +1,7 @@
package Lemonldap::NG::Common::Conf::Serializer; package Lemonldap::NG::Common::Conf::Serializer;
use strict;
use utf8;
use Data::Dumper; use Data::Dumper;
our $VERSION = '1.9.0'; our $VERSION = '1.9.0';
@ -160,12 +162,12 @@ sub unserialize {
# Value should be a Data::Dumper, else this is an old format # Value should be a Data::Dumper, else this is an old format
if ( defined($v) and $v !~ /^\$/ ) { if ( defined($v) and $v !~ /^\$/ ) {
$msg .= $Lemonldap::NG::Common::Conf::msg .=
" Warning: configuration is in old format, you've to migrate!"; " Warning: configuration is in old format, you've to migrate!";
eval { require Storable; require MIME::Base64; }; eval { require Storable; require MIME::Base64; };
if ($@) { if ($@) {
$msg .= " Error: $@"; $Lemonldap::NG::Common::Conf::msg .= " Error: $@";
return 0; return 0;
} }
$conf->{$k} = Storable::thaw( MIME::Base64::decode_base64($v) ); $conf->{$k} = Storable::thaw( MIME::Base64::decode_base64($v) );
@ -181,7 +183,7 @@ sub unserialize {
eval $v; eval $v;
if ($@) { if ($@) {
$msg .= " Error: cannot read configuration key $k: $@"; $Lemonldap::NG::Common::Conf::msg .= " Error: cannot read configuration key $k: $@";
} }
# Store value in configuration object # Store value in configuration object