You are here: custom error script taking too long. « PHP Programming Language « IT news, forums, messages
custom error script taking too long.

Posted by Nate Baxley on 09/11/06 07:07

OK, I'm taking my first stab at a custom error handler. Here's what
I've got but it takes a very long time to return. If I remove the die
command it reutrns much faster, but then I get several error messages
when I only want one. Any ideas?

Nate Baxley

function ErrorHandler($code, $msg, $file, $line) {
?><h1>Something wrong has happened</h1>
<?
echo('<strong>Error: <em>' . $msg . '</em> on line <em>' . $line .
'</em></strong>');
$bt=debug_backtrace();
echo('<table cellpadding="2" cellspacing="1" border="1"><caption
style="text-align:left; font-weight:bold; color:red;">Backtrack
Report</caption><tr><th>Line</th><th>File</th></tr>');
for ( $i=0; $i<count($bt); $i++) {
echo('<tr><td>' . $bt[$i]['line'] . '</td><td>' . $bt[$i]['file'].
'</td></tr>');
}
echo('</table>');
die();
}

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация