From: Marcus Ramberg Date: Wed, 23 Jul 2008 07:29:40 +0000 (+0000) Subject: Show actual parse errors X-Git-Tag: v0.13~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FConfig-Any.git;a=commitdiff_plain;h=92c29326caaebb0ded4acf22cf92f4d6fb707eba Show actual parse errors --- diff --git a/Changes b/Changes index f19d6f1..b61b057 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Revision history for Config-Any + - Show actual parse error when parse fails (Marcus Ramberg). + 0.12 Mon 07 Apr 2008 - ensure Perl loader dies on a failed require() (RT #32995) diff --git a/lib/Config/Any.pm b/lib/Config/Any.pm index dce93ce..14b31a7 100644 --- a/lib/Config/Any.pm +++ b/lib/Config/Any.pm @@ -159,6 +159,7 @@ sub _load { } my @results; + warn $@ if $@; for my $filename ( @{ $args->{ files } } ) { @@ -179,7 +180,7 @@ sub _load { = eval { $loader->load( $filename, $loader_args{ $loader } ); }; # fatal error if we used extension matching - croak "Error parsing file: $filename" if $@ and $use_ext_lut; + croak "Error parsing $filename: $@" if $@ and $use_ext_lut; next if $@ or !@configs; # post-process config with a filter callback