Disable fancy errors in CakePHP
Posted on 21 July 2009 (04:35 PM)
Here at work we often go crazy because of CakePHP's "helpful" displaying of error messages.
They are littered with HTML and, even worse, Javascript and provide an often superfluous stack trace, which makes it harder to read the actual error message.
If you just want readable, plain text error messages in your projects, add the following to /app/config/bootstrap.PHP:
function displayErrorWithoutCrap() {// returning false here means the internal PHP error handler will take over again and display a neat, clean errorreturn false;}set_error_handler('displayErrorWithoutCrap');- Download this code: /code/disable_fancy_errors_in_cakephp1.txt
And if the Cake guys could make this configurable in their next release, that would just be awesome.
- ← previous article: Move current selection to new folder with Applescript
- → next article: Testing IE6 on Mac using VirtualBox
Comments:
No comments have been added yet, you could be the first!