[Dbix-class] exception_action fail after DBIC upgrade

Peter Rabbitson rabbit+dbic at rabbit.us
Tue Dec 18 08:04:25 GMT 2012


On Mon, Dec 17, 2012 at 07:31:27AM -0800, Bill Moseley wrote:
> On Mon, Dec 10, 2012 at 1:09 AM, Peter Rabbitson <rabbit+dbic at rabbit.us>wrote:
> 
> > On Mon, Dec 10, 2012 at 12:30:52PM +0400, Konstantin A. Pustovalov wrote:
> > > Hello list!
> > >
> > > I'm using exception_action feature. Some of my tests fail after
> > > upgrading 0.08196 -> 0.08204
> > > I have reduced  test case to the following:
> > http://paste.scsys.co.uk/217862
> > > exception_action is never get called in my setup. Am I doing
> > > something wrong or is it intended behavior?
> >
> > Unintended breakage due to lack of tests - so when a refactor broke it
> > things went unnoticed. Can you please add several tests like the one
> > attached to t/34exception_action.t[1], and we will fix it for the next
> > version.
> >
> 
> To be clear, this is not so much related to exception_action as is with
> some interaction with Exception::Class, right?

Very wrong.

> That is, even without
> setting exception_action calling My::X->throw still has its exception
> eaten.

No. exception_action is something that is specific to a schema *instance*,
and what happened is precisely that some $schema->throw_exception calls
got converted to DBIC::Exception->throw, entirely bypassing the custom
handler. The exception is not "eaten" - it is simply never presented to the
handler coderef, which is what this bugreport is about.

> Checking $@ isn't really safe before 5.14, BTW.

This isn't technically correct, nor relevant ;)



More information about the DBIx-Class mailing list