OpenCageData / perl-Geo-Address-Formatter

Perl module to take structured address data and format it.
https://metacpan.org/pod/Geo::Address::Formatter
8 stars 4 forks source link

new() should fail when config file(s) not found #6

Closed mtmail closed 3 years ago

mtmail commented 3 years ago

It's possible to call

my $GAF = Geo::Address::Formatter->new( conf_path => '/tmp/does-not-exist/' );

which leads to an error message

No such file or directory at [...]/YAML/XS.pm line 48.

and an error for each

my $lines = $GAF->format_address($rh_address, {abbreviate => 1}); Use of uninitialized value $template_text in hash element at [...]/Geo/Address/Formatter.pm line 208.

I would argue an invalid path to new() should lead to a fatal error so the script can't continue.

freyfogle commented 3 years ago

yes, fair point

freyfogle commented 3 years ago

solved in v1.89 https://metacpan.org/release/EDF/Geo-Address-Formatter-1.89