How to store error messages in variables?
Hi All,
I am trying to get all the errors in a variable. The problem is that I can get missing controller and missing method or error404 like errors. But I want to get warnings and notice errors in variable. How to do this. I am just trying to make site error free. So that if someone is using site, he/she will not be able to see errors and the actual error will be send to me in email.
So please help me. How to get notice and warning errors like missing value, divide by 0, missing arguments, etc. like errors.
Is there ant component or helper for that?
Thank You.
Asked by lakum4cakephp, on 1/2/10
1 Answer
You can trap all the error calls by creating an AppError class in your app/ directory. Basically you will trap all the error types take cakePHP throws and they will go through your AppError class before proceeding to their normal route.
Inside this class you can then email the errors to yourself before the user sees them and then redirect the user to whatever page you want.
Here's a link to information about creating your custom AppError class:
http://book.cakephp.org/view/154/Error-Handling
Answered by davidwuon 3/2/10
Your Answer
You can use Creole Wiki Syntax to format your text.
Tagged with
Rating
0
Viewed
232 times
Last Activity
on 3/2/10