What is the best method to handle errors?
Posted: Thu Jan 08, 2004 7:07 am
I have designed an error function that is managing my errors but I would like to know if is there any other method, a better one.
Code: Select all
<?php
function myErrorHandler ($errno, $errstr, $errfile, $errline)
{
//My-SQL errors
$Error_Codes[1]="This is an error";
?>
<HTML>
<HEAD>
</HEAD>
<BODY>
<table>
<tr>
<td>
<font class="title"><b><? echo $Error_Codes[$errstr];?><br>
</td>
</tr>
</table>
</BODY>
</HTML>
<?
exit();
}
error_reporting (E_ERROR);
$old_error_handler = set_error_handler("myErrorHandler");
?>