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

Re: Core exception types [was: Re: Pre-RFC: Improve “wide character” warnings]

Thread Previous | Thread Next
From:
Ovid
Date:
June 8, 2022 16:18
Subject:
Re: Core exception types [was: Re: Pre-RFC: Improve “wide character” warnings]
Message ID:
CA+M4CHtWi-A214y-s5w_qOb6HXpwTqoizfr-jteS8Hf+vdeipg@mail.gmail.com
On Wed, Jun 8, 2022 at 1:13 PM Paul "LeoNerd" Evans <leonerd@leonerd.org.uk>
wrote:

> What should we do here?
>
>  1) Throw objects of some core-defined type, so `ref` and `blessed` are
>     now true on these things, meaning they can be distinguished -
>     including by some sort of `isa` test as might someday be added to
>     `catch`, but thus breaking all existing code which inspects $@ or
>     $e.
>
>

<snip>

>
> I don't like option 1 because of all the breakage it causes.
>

Paul, can you elaborate on the breakage? If try {...} catches non-blessed
errors and upgrades them to a Exception::Legacy object which stringifies
(or numifies) on demand (feature guarded, of course), why does this break
stuff? Maybe I missed it in the thread, and I'm sure there will be code
which still breaks, but it seems the majority of legacy code would work
with this (especially since the majority of legacy code doesn't use your
try/catch).

Ovid
CTO, All Around the World
World-class software development and consulting
https://allaroundtheworld.fr/

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