Subject: | Exception handling weak |
In _slurp I see:
return do { local $/; <$fh> };
But <$fh> can fail and often fails nowadays due to the :utf8 layer:
utf8 "\xF6" does not map to Unicode at
/home/src/perl/repoperls/installed-perls/perl/v5.13.11-368-gc2c97af/lib/5.14.0/Parse/CPAN/Meta.pm
line 89, <$fh> chunk 1.
That should be wrapped in an eval and accompanied with diagnostics that
tell the user the file that failed.
Same problem when parsing the YAML fails. The diagnostics then is just
something like
Stream does not end with newline character at bin/parse-all-meta.pl line 65
or
CPAN::Meta::YAML does not support a feature in line
'!!perl/hash:Module::Build::Version' at bin/parse-all-meta.pl line 65
or
CPAN::Meta::YAML failed to classify line '{' at bin/parse-all-meta.pl
line 65
On current CPAN YAML::Syck cannot parse 205 META.yaml files, YAML::XS
cannot parse 450, but Parse::CPAN::Meta cannot parse 667. The more
important is the error handling.
WDYT?