[Maypole] catching DB errors
Toby Corkindale
maypole@wintrmute.net
Mon, 24 Jan 2005 18:24:00 +0000
Hi,
During the test/debug/fix process, I frequently am thrown DB errors, such as
when trying to insert a record is a duplicate but has a unique index upon it.
(eg. id serial primary key, username varchar(32) not null unique)
The DB errors currently go to the apache error_log, and the user sees a 404
Page not found error.
It'd be nice to present a page saying "Sorry you hit an error:" and then
displays the error message, at least, for our testing purposes.
What would be the best way to go about this in Maypole?
I suspect it'd involve creating a custom Class::DBI _croak() function in the
model classes, but I'm not sure.. What do you think?
thanks,
Toby