On Sun, 20 May 2007, A. Pagaltzis wrote:
* Dave Rolsky <[EMAIL PROTECTED]> [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?
No, I mean the session. I always keep the URIs for my form display and
form submission separate, and I do a redirect after form submission.
In the Catalyst case, I generally take advantage of the flash feature,
since it's perfect for this sort of stuff.
-dave
/*===================================================
VegGuide.Org www.BookIRead.com
Your guide to all that's veg. My book blog
===================================================*/
_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/