Re: Better handling of constraint failures?

[prev] [thread] [next] [Date index for 2004/10/24]

From: Tony Bowden
Subject: Re: Better handling of constraint failures?
Date: 13:52 on 24 Oct 2004
On Thu, Aug 12, 2004 at 04:01:46PM -0400, Daniel Collis Puro wrote:
> Here's the solution I came up with: Is this something that can make it
> into Class::DBI proper?
> I overrode add_constraint() in my Class::DBI subclass and have it now
> return more useful information into %info in _croak().
> 
>       or return $self->_croak(
>       "$class $column fails '$name' constraint with '$value'", (
>        exception_type=>'constraint_failure', 
>        column=>$column, 
>        value=>$value,  
>        constraint_name=>$name  
>       );
> }
> Thoughts?  I think more informational exceptions would generally be a
> nice feature.

I'm all for passing this extra information, but I'm not entirely
convinced by just passing an extra bundle of info like this to croak.

Perhaps we should throw some sort of exception object here with all this
information?

Tony

Re: Better handling of constraint failures?
Drew Taylor 17:27 on 12 Aug 2004

Re: Better handling of constraint failures?
Clayton L. Scott 19:29 on 12 Aug 2004

Re: Better handling of constraint failures?
Drew Taylor 19:54 on 12 Aug 2004

Re: Better handling of constraint failures?
Clayton L. Scott 19:53 on 12 Aug 2004

Re: Better handling of constraint failures?
Clayton L. Scott 20:01 on 12 Aug 2004

Re: Better handling of constraint failures?
Perrin Harkins 19:51 on 12 Aug 2004

Re: Better handling of constraint failures?
Daniel Collis Puro 20:01 on 12 Aug 2004

Re: Better handling of constraint failures?
Clayton L. Scott 20:04 on 12 Aug 2004

Re: Better handling of constraint failures?
Daniel Collis Puro 20:42 on 12 Aug 2004

Re: Better handling of constraint failures?
Clayton Scott 21:49 on 12 Aug 2004

Re: Better handling of constraint failures?
Tony Bowden 13:52 on 24 Oct 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52