[Dbix-class] DBIx::Class::Exceptions

Peter Rabbitson rabbit+dbic at rabbit.us
Mon Nov 5 09:19:18 GMT 2012


On Fri, Nov 02, 2012 at 03:41:48PM +1100, Toby Corkindale wrote:
> Hi,
> It used to be the case (some versions ago) that if you died with an object
> inside a txn_do() then the re-thrown error would still contain that object.
> 
> However now it seems to be stringified on the way out.
> 
> To give an example, I'm sure I used to be able to do this:
> 
> try {
>   $schema->txn_do(sub {
>       die Custom::Exception->new(msg => "foobar");
>   });
> }
> catch {
>   $_->custom_exception_method;
> };
> 
> Is there any way to get back to that behaviour?

This particular behavior is still there. I pushed a branch demonstrating 
it[1]. There are however improvements in the pipelines for this 
codepath. In any case - can you look at the branch in question and point 
out which part doesn't work as you expect?


Cheers

[1] http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits/DBIx-Class.git;a=commitdiff;h=f69038482b



More information about the DBIx-Class mailing list