I'm thinking of developing a web app with Class:DBI. All is well but I think I'm missing something simple.
I would like to use constraints to do data validation.
Seems simple enough, problem is, constraint failures die. I don't want this so I override _croak. But, then what?
I would like to catch the error, but on returning from my _croak Class::DBI still sets the bad value.
From the Class::DBI docs
When using this mechanism for form data validation, for example, this exception data can be stored in an exception object, via a custom _croak() method, and then caught and used to redisplay the form with error messages next to each field which failed validation.
So I know it can be done, but I'm not sure I see how.