http://qs321.pair.com?node_id=382530


in reply to Better way to catch Class::DBI constraint failures?

Try having a look at Class::DBI::FromCGI instead. It uses CGI::Untaint in a separate step to validate arguments, so Class::DBI's constraint checking becomes a mere safety net.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re^2: Better way to catch Class::DBI constraint failures?
by Hero Zzyzzx (Curate) on Aug 13, 2004 at 03:48 UTC

    I've checked that one out, thanks! One reason I wanted to use CDBI constraints is to have my form validation logic exist only in one place. "Don't repeat yourself" and all that pragmatic stuff.

    Anyway, I figure if I can just get Class::DBI to emit more meaningful exceptions from constraint failures I can catch those in an overridden CDBI::_croak. You can read more detail here on the CDBI mailing list.

    -Any sufficiently advanced technology is
    indistinguishable from doubletalk.

    My Biz