News Feed
Jobs Feed
Sections




News Archive
Felix Geisendorfer's Blog:
Exceptional Cake
October 22, 2007 @ 10:21:00

Felix Geisendorfer has posted a new blog entry he's been promising for a while now - a look at using Exceptions in a CakePHP application:

First of all. Why did I decide to experiment with exceptions in CakePHP? Well, Object::cakeError() does an ok job at providing me with a way to render some sort of internal error while I'm debug mode. However, I think that is what its really meant for, and its not the way to go for rendering errors to the user directly. [...] [All of] these things can be addressed by using PHP5s support for custom Exception classes quite elegantly.

He includes an example of the exception handling in action - an AppError controller that extends the ErrorHandler and an AppException class that extends the normal Exception class for some customized methods. Example usage is also included, showing how to check things like the Subversion version of a file and checking properties of objects.

0 comments voice your opinion now!
cakephp framework exception handling error example cakephp framework exception handling error example


blog comments powered by Disqus

Similar Posts

DevShed: Error Handling in PHP - Coding Defensively

Zend Developer Zone: This Week in the Zend Framework - Issue #10

Shane O'Sullivan's Blog: The Cake PHP MVC framework and its Amazing Technicolor Documentation

Bas De Nooijer's Blog: Benchmarking PHP Solr response data handling

Chris Hartjes' Blog: A New Way Of Judging Frameworks: Where are the tests?


Community Events









Don't see your event here?
Let us know!


composer zendframework2 release database testing development opinion example community introduction event object language interview functional api unittest framework code phpunit

All content copyright, 2013 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework