[Catalyst] Re: Form validation in insert() and update()?
A. Pagaltzis
pagaltzis at gmx.de
Sun May 20 04:18:30 GMT 2007
* Dave Rolsky <autarch at urth.org> [2007-05-15 01:00]:
> eval
> {
> $user->update( %bunch_of_stuff );
> };
>
> if ( my $e = Exception::Class->caught(
> 'My::App::Exception::DataValidation') )
> {
> # $e->errors contains multiple data validation error messages
> # stuff them in the session
> # save the user's form submission in the session
> # redirect back to form
> }
> elsif ( my $e = $@ )
> {
> die $e;
> }
>
> Then on the display side, I check the session for error
> messages and saved form arguments, and do something useful with
> them.
Surely you mean the stash, not the session?
Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/>
More information about the Catalyst
mailing list