News Feed
Sections




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

Till Klampaeckel's Blog:
Tracking PHP errors
November 29, 2010 @ 13:20:07

Till Klampaeckel has put together this new post looking at the track_errors ini option (that will always put the latest error message in $phperrormsg) and how it can help you more efficiently handle the errors your application throws.

track_errors provides the means to catch an error message emitted from PHP. It's something I like to use during the development of various applications, or to get a handle on legacy code. Here are a few examples why!

He gives the example of a failed file_get_contents that results in a warning. He suggests that, instead of suppressing the error, you set display_errors to "off" and throw an exception when on the failure. There's trade-offs though including the fact that it's in the global scope and additional work would have to be done to handle problems inside other scopes.

0 comments voice your opinion now!
track error trackerrors exception handling


blog comments powered by Disqus

Similar Posts

Conor Mac Aoidh's Blog: OS X: Audio Alerts for PHP Errors

NETTUTS.com: 404/403 Website Error Pages With PHP Auto-Mailer

ThinkPHP Blog: Handling large files with(out) PHP

SitePoint PHP Blog: Pimpin Harry’s pretty bluescreen

Daniel Cousineau's Blog: Quickie: Module-specific Error Controllers in Zend Framework (1.5)


Community Events





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


conference laravel zendserver community bugfix language tips introduction threedevsandamaybe api podcast series deployment release code symfony development framework list interview

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