News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

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

Matt Curry's Blog: Giving Away A Free Copy Of CakePHP Application Development

Three Devs & A Maybe Podcast: Delving into CodeIgniter

Symfony Project: Heading towards symfony 1.0

The Bakery: Six New Components/Articles/Tutorials (SOAP, XHR, Tickets, Models, Releases & Flashes)

Professional PHP Blog: The rumors of PEAR\'s demise are greatly exaggerated


Community Events

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


introduction podcast application framework interview laravel opinion api performance series configure voicesoftheelephpant php7 language release community conference example symfony2 part2

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