All pastes #674275 Raw Edit

Something

public text v1 · immutable
#674275 ·published 2007-08-29 02:27 UTC
rendered paste body
function Toms_Error_Handler($errno,$errstr,$errfile,$errline,$errcontext)
{
	switch ($errno)
	{
		case E_ERROR: 			$Error_Type = "E_Error"; 		break;
		case E_WARNING:			$Error_Type = "Warning"; 		break;
		case E_PARSE: 			$Error_Type = "Parse Error"; 	break;
		case E_NOTICE: 			$Error_Type = "Notice"; 		break;
		case E_CORE_ERROR:		$Error_Type = "Core Error";		break;
		case E_CORE_WARNING:	$Error_Type = "Core Warning";	break;
		case E_COMPILE_ERROR:	$Error_Type = "Compile Error";	break;
		case E_COMPILE_WARNING:	$Error_Type = "Compile Warning";break;
		case E_USER_ERROR:		$Error_Type = "User Error";		break;
		case E_USER_WARNING:	$Error_Type = "User Warning";	break;
		case E_USER_NOTICE:		$Error_Type = "User Notice";	break;
		case E_STRICT:			$Error_Type = "Strict Notice";	break;
		case E_RECOVERABLE_ERROR:$Error_Type = "Recoverable Error";	break;
		default:				$Error_Type = "Unknown Error ($errno)";	break;
	}
	if (defined("DBG"))
	{
		$ERROR_PRINTOUT  = "<br />An Error has occurred<br />";
		$ERROR_PRINTOUT .= "ERROR TYPE: <b> $Error_Type </b> <br />";
		$ERROR_PRINTOUT .= "FIlE: <b> $errfile </b> ON LINE <b> $errline </b> <br />";
		$ERROR_PRINTOUT .= "ERROR PRINTOUT:<br />";
			$ERROR_PRINTOUT .= "<textarea cols='50' rows='10'>";
			$ERROR_PRINTOUT .= $errstr;
			$ERROR_PRINTOUT .= "</textarea><br />";
		$ERROR_PRINTOUT .= "VARS ARRAY:<br />";
			$ERROR_PRINTOUT .= "<textarea cols='50' rows='20'>";
			foreach ($errcontext as $varPrintout)
			{
				$ERROR_PRINTOUT .= $varPrintout . "\n";
			}
		$ERROR_PRINTOUT .= "<br /> END ERROR PRINTOUT <br />";
	} else
	{
		$ERROR_PRINTOUT = "An error has occurred and has been documented and the developers notified.";
	}
	echo $ERROR_PRINTOUT;
	return true;
}