toggle Cinema 25 Jun 2009

Beautifull php exceptions Posted by Insane in Php | No responses

Una manera de notificar los errorres del interprete de una forma nice (creo).

function _myErrorReporter(){
	$template = file_get_contents('my_errors.phtml');
	die(str_replace('%str_err%',$e,$template));
}
set_error_handler(create_function('$x, $y', 'throw new Exception($y,$x);'), E_ALL & E_NOTICE & E_WARNING);
set_exception_handler(create_function('$e', _myErrorReporter($e); '));
  • Share/Bookmark

Tags: ,

Promote this post

Would you like to add this post to your bookmarks? Come on, do not miss any updates and stay tuned.
Please share with us!

This entry no have comments but you can be first .

Leave a Reply ( Guest )

(*)

(will not be published) (*)