trevor2487
Posts: 5
|
| Posted: 09/03/2008, 6:51 PM |
|
Hi all,
I found this part of a response to the above in the forums from 2004 by peterr:
"I believe that currently in CCS (PHP) the script just stops when there is a database error, though the error is shown by the PHP engine. We had couple requests for improving the error handling by passing the control to the developer and this will be implemented in a future version of CCS (it's already done in another version we're working on). However, if you need this only for custom code (events) that updates additional database tables then probably there is a way to catch errors. I can find out more info if this what you need."
Does anyone know if this implementation of improved mySQL error handling has progressed at all?
Thanks,
Trevor
|
 |
 |
karen
Posts: 99
|
| Posted: 01/26/2009, 6:56 PM |
|
Hi all,
I would really love to know how to replace DB errors with a friendly error message. I have a unique key setup in the DB and I want to display a custom error message that's friendlier. I read the following on another post and would really love to have some more details if anyone knows. The following excerpt from http://forums.yessoftware.com/posts.php?post_id=87421&s_keyword=catch+error
Quote :What do you want to do when you "catch" it?
The errors are managed by the clsErrors.
Look at your Classes.php.
Are you trying to replace it with a friendly error mesage?
The erros are contained in the $Component->Datasource->Errors
Execution ordrer is to call the operation() method, redirect if necessary,
and then call the individual component 's Show() method.
I believe that in the BeforeShow of the form you could iterate through the
Erros array and replace with a friendly message (or delete altogether).
Thanks in advance!
Cheers,
Karen
|
 |
 |
jjrjr1
Posts: 942
|
| Posted: 01/27/2009, 8:51 AM |
|
Hi
It is really pretty easy to handle mysql errors (as well as any others) by modifying db_mysql.php and .htaccess
In fact here is a CCS code drop in that will do just that and also allow you to build CCS pages to handle the error thus allowing you to process the error any way you want, including DB updates and access.
http://ccselite.com/online_store.php?pid=3
Have Fun.
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
|