On Wed, Jun 8, 2022 at 6:25 PM Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> wrote: > > 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 <snip> > > Ah, now that's an interesting thought. Combined with: > > On Wed, 8 Jun 2022 16:06:47 +0200 > Alexander Hartmaier <alex.hartmaier@gmail.com> wrote: > > > 3) use a new variable that holds the exception object and populate $@ > > with its string representation? > > This might actually be a thing. > > We can't change the existing behaviour of $@, but we *could* create > some other variable, say, ${^EXCEPTION}, that would receive these new > objects, and say that actually the catch var uses that instead: > > try { ... } > catch($e) { > if($e isa X::Perl::ENOENT) { ... } > } > > These objects could then have whatever new interface we decided. > <leonerd@leonerd.org.uk> And if we want to go even further, this is from the Carp documentation: BUGS The Carp routines don't handle exception objects currently. If called with a first argument that is a reference, they simply call die() or warn(), as appropriate. Might be something interesting to consider there. Best, Ovid CTO, All Around the World World-class software development and consulting https://allaroundtheworld.fr/Thread Previous | Thread Next