develooper Front page | perl.perl5.porters | Postings from June 2022

Re: Pre-RFC: add version numbers to errors/warnings containingpackage names

Thread Previous | Thread Next
From:
Darren Duncan
Date:
June 1, 2022 11:02
Subject:
Re: Pre-RFC: add version numbers to errors/warnings containingpackage names
Message ID:
c9438285-6def-96ad-a6b6-e7f2ae0f69cc@darrenduncan.net
On 2022-06-01 2:54 a.m., Tom Molesworth via perl5-porters wrote:
>         On 2022-05-28 4:16 a.m., Ovid wrote:
>          > Not sure what it would take to do this, but this kind of error crops
>         up a few times:
>          >
>          > Can't locate object method "some_method" via package "Some::Class"
>          >
>          > In my case, it turns out that some CPAN testers were using versions of a
>          > Type::Tiny released eight years ago.
>          >
>          > It would be nice if the error looked like this:
>          >
>          > Can't locate object method "some_method" via package "Some::Class,
>         version 1.01"
> 
> This effectively means "call the ->VERSION method", which would seem to add some 
> complexity? side effects of the method, what if it throws an exception, etc.

This could be implemented using a simpler safer approach that may miss the 
version in edge cases but this doesn't have to give a version in every instance. 
  The call can trap exceptions, or it can limit to reading $VERSION.

> Aside from that, keeping the version *outside* the quoted string may help reduce 
> breakage for anything that's trying to parse the existing string.

I agree with this, it is the most backwards compatible if the new information is 
just appended to the end of the string that was there before, and leave the old 
string exactly as it was.

-- Darren Duncan

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About