Location: PHPKode > projects > Dev's CMS > devscms/includes/class.error.php
<?php

class errors
{
	public static function errorHandler($errno, $errstr, $errfile, $errline)
	{
		// if error has been supressed with an @
		if (error_reporting() == 0) {
			return;
		}
		
		echo "<h1>Error: $errstr</h1>";
		echo "<i>$errfile @ line #$errline</i>";
		echo '<pre>';
		
		foreach (debug_backtrace() as $b) {
			if (!isset($b['file']) || $b['file'] != $errfile || $b['line'] != $errline) {
				var_dump($b);
			}
		}
		
		echo '</pre>';
		die;
	}
	
	public static function exceptionHandler(Exception $exception)
	{
		echo "<h1>Error: {$exception->getMessage()}</h1>";
		echo "<i>{$exception->getFile()} @ line #{$exception->getLine()}</i>";
		echo '<pre>';
		
		/*foreach (debug_backtrace() as $b) {
			if ($b['file'] != $errfile || $b['line'] != $errline) {
				var_dump($b);
			}
		}*/
		echo $exception->getTraceAsString();
		
		echo '</pre>';
		die;
	}
}
Return current item: Dev's CMS