* @copyright 2001-2007 VIKO team and contributors * @license http://www.gnu.org/licenses/gpl.html GPL 2.0 */ /** * Handles errors * */ class ErrorHandler { /** * Handles any error */ function General ( $error_nr, $message, $file, $line ) { switch ($errno) { case E_USER_ERROR: echo "Error: $message in $file at line $line.\n"; exit(1); break; case E_WARNING: case E_USER_WARNING: echo "Warning: $message in $file at line $line.\n"; break; case E_NOTICE: case E_USER_NOTICE: echo "Notice: $message in $file at line $line.\n"; break; default: echo "Unknown error type: [$errno] $errstr in $file at line $line.\n"; break; } } } set_error_handler("ErrorHandler::General"); ?>