Intercept Database Error Message
520817Sep 9 2008 — edited Sep 9 2008Hello,
Is there an easy way to intercept a database generated error so that
you can redirect Apex to a "pretty" error page rather than showing
the default database error message on the page?
For example, if you have a date field (defined as DATE in the database)
and the user doesn't enter a date in the correct format, then when
you attempt an update on their record, you get an error like:
ORA-01840: input value not long enough for date format
on a default page. I'd like to intercept that error message/number
somewhere and redirect to a "nice" error page.
I'm working over a database link. So the form data is being passed to
a package on the back-end that's doing the update.
I had attempted to have the package return a certain value to Apex
and redirect from that but it didn't work for some reason.
Thanks.