Posts Tagged ‘error handling’
Displaying custom error message with the right HTTP response codes
Posted by primeminister | Filed under Cake-Toppings
I’m building an RESTful API with CakePHP now. That is great stuff. Very easy and quick for the basics. Some more info on how to in the book and here.
But I wanted a custom XML error message with the right HTTP respond code like the Twitter API does. I knew it could be done with overwriting the AppError class and make my own custom method.
This is how I did it: (more…)