Beautifull php exceptions
Jun 25th, 2009 by Insane
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); ‘)
);
No es necesaria una gran introducción de firebug, así que solo les dejo el howto.
