develooper Front page | perl.perl5.porters | Postings from July 2013

Re: Try/Catch Exception Objects: Possible?

Thread Previous | Thread Next
From:
Lukas Mai
Date:
July 27, 2013 22:44
Subject:
Re: Try/Catch Exception Objects: Possible?
Message ID:
51F44D3E.1030804@gmail.com
On 24.07.2013 00:05, Aristotle Pagaltzis wrote:
> * David E. Wheeler <david@kineticode.com> [2013-07-23 22:00]:
>> The catch block should not do conditional execution. One should use
>> a switch statement or whatever inside the catch block.
>
> That means if you want to take only the exceptions you understand how to
> handle, then a) you need another level of nesting and b) you need to add
> boilerplate to rethrow the exception.
>
> That is exactly what grates on me when I use Try::Tiny. But I don’t hold
> that against it: Perl simply does not provide the means to sanely offer
> better as a module.

Try::Tiny::ByClass tries to do that.

-- 
Lukas Mai <plokinom@gmail.com>

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